A_SpawnParticle... Reogrenized.

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8192
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

A_SpawnParticle... Reogrenized.

Post by Major Cooke »

https://github.com/rheit/zdoom/pull/498
https://github.com/rheit/acc/pull/39

...Do I even need to comment on this?

I will say one thing though. if this gets in, I'm nuking the wikipage. The date of entry will point to this git in particular.
Last edited by Major Cooke on Thu Jan 21, 2016 8:03 pm, edited 1 time in total.
Gez
 
 
Posts: 17902
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_SpawnParticle... Reogrenized.

Post by Gez »

You fault for creating it so soon. :p
User avatar
Xaser
 
 
Posts: 10773
Joined: Sun Jul 20, 2003 12:15 pm

Re: A_SpawnParticle... Reogrenized.

Post by Xaser »

This is still highly un-optimal, as the flags/lifetime parameters are buried behind all the position/movement ones. I don't want to have to type 'A_SpawnParticle("#FFFFFF', 0, 0, 0, 0, 0, 0, 0, 35, SPF_FULLBRIGHT)' if all I want is a non-moving glowy particle.

My suggestion:
A_SpawnParticle(color, flags, lifetime, size, xoff, yoff, zoff, velx, vely, velz, accelx, accely, accelz, startalpha, fadestep)

This puts all the x/y/z ones in order, puts flags near the beginning, and leaves startalpha/fadestep at the end since they have nonzero defaults and (IMO) are likely to be the least-used ones.

Probably a good idea to make zero for lifetime and size mean "use default" if it doesn't yet, since a value of 0 wouldn't make sense for either. Can maybe say the same for startalpha/fadestep, so feel free to do so and move those earlier in the list.

Thinking on it, defaults for everything except color is probably a good idea as well. Just whatever order allows me to not have to type a zillion zeroes for the position/velocity params. :P
User avatar
Major Cooke
Posts: 8192
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: A_SpawnParticle... Reogrenized.

Post by Major Cooke »

Done.

Yes, the angle parameter on the decorate version is before the offsets. I'll need more access to that than you think...
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am

Re: A_SpawnParticle... Reogrenized.

Post by Eevee »

Hm! I rewrote the particle fountains in DECORATE — this should be exactly identical to native, except for some minor precision and RNG details. This uses the current arg order on master, of course.

Main source of ugliness is that you can't choose a string at random (for the color), so the entire call has to be duplicated. Alas, you can't have string user vars either, so each color of fountain would have to duplicate all of this as well.

Code: Select all

ACTOR TestRedParticleFountain
{
	Height 0
	+NOBLOCKMAP
	+NOGRAVITY
	+INVISIBLE

	var int user_angle;
	var int user_dist;

	states
	{
	Spawn:
		TNT1 A 2
		TNT1 A 0 A_SetUserVar("user_angle", random(0, 360))
		TNT1 A 0 A_SetUserVar("user_dist", frandom(0.0, 1.0 * radius))
		TNT1 A 0 A_JumpIf(random(0, 255) < 30, "Color2")
	Color1:
		TNT1 A 0 A_SpawnParticle(
			/* offset */ user_dist * cos(user_angle), user_dist * sin(user_angle), (height + 1) * 1.0,
			/* velocity */ frandom(-128.0, 127.0) / 4096.0, frandom(-128.0, 127.0) / 4096.0, frandom(-128.0, 127.0) / 4096.0 + 3.0 + ((user_dist < radius / 8) * 0.333),
			/* color */ "ff 00 00",
			/* lifetime */ 51,
			/* flags */ 0,
			/* alpha */ 255,
			/* size */ 6,
			/* fadestep */ -1.0,
			/* accel */ frandom(-128.0, 127.0) / 16384.0, frandom(-128.0, 127.0) / 16384.0, frandom(-128.0, 127.0) / 16384.0 - 0.0909,
			/* angle */ 0)
		Goto Spawn
	Color2:
		TNT1 A 0 A_SpawnParticle(
			/* offset */ user_dist * cos(user_angle), user_dist * sin(user_angle), (height + 1) * 1.0,
			/* velocity */ frandom(-128.0, 127.0) / 4096.0, frandom(-128.0, 127.0) / 4096.0, frandom(-128.0, 127.0) / 4096.0 + 3.0 + ((user_dist < radius / 8) * 0.333),
			/* color */ "ff 7f 7f",
			/* lifetime */ 51,
			/* flags */ 0,
			/* alpha */ 255,
			/* size */ 4,
			/* fadestep */ -1.0,
			/* accel */ frandom(-128.0, 127.0) / 16384.0, frandom(-128.0, 127.0) / 16384.0, frandom(-128.0, 127.0) / 16384.0 - 0.0909,
			/* angle */ 0)
		Goto Spawn
	}
}
Screenshot_Doom_20160121_182044.png
You do not have the required permissions to view the files attached to this post.
User avatar
Major Cooke
Posts: 8192
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: A_SpawnParticle... Reogrenized.

Post by Major Cooke »

Nothing I can do about it, sadly. I think that has to wait for doomscript, for strings anyway.
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: A_SpawnParticle... Reogrenized.

Post by Nash »

Yo don't forget about us ACS folks
User avatar
Major Cooke
Posts: 8192
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: A_SpawnParticle... Reogrenized.

Post by Major Cooke »

No I sure didn't. This time...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_SpawnParticle... Reogrenized.

Post by Graf Zahl »

Eevee wrote:you can't choose a string at random (for the color),
I thought it'd parse an int as well. But apparently it doesn't. Well, this will have to wait for the scripting branch to get merged. I'm not going to mess around with the old parser for this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_SpawnParticle... Reogrenized.

Post by Graf Zahl »

Merged.

But this makes me think:

The ACS version uses absolute coordinates. I wonder if it makes sense to add a second variant that uses a map spot tid instead. As it is it can only be used for effects that are placed in the world - not for effects that are tied to an actor.
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: A_SpawnParticle... Reogrenized.

Post by kodi »

I haven't looked through the function, but shouldn't using getactorx(TID) and getactory(TID) + eventual offsets be enough?
Very excited for this anyway.
Edit: I see. An alternate function sounds like a great idea then.
Last edited by kodi on Fri Jan 22, 2016 5:45 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_SpawnParticle... Reogrenized.

Post by Graf Zahl »

That wouldn't allow spawning stuff at multiple points with one call.
User avatar
Fishytza
Posts: 785
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: A_SpawnParticle... Reogrenized.

Post by Fishytza »

Since there are 16 parameters (for the DECORATE version) numbered 0 to 15, shouldn't ACTION_PARAM_START be 16?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_SpawnParticle... Reogrenized.

Post by Graf Zahl »

If it actually did something - yes. This was meant to be some advance preparation for scripting but Randi chose to do it differently, so it's rather moot to care.
User avatar
Fishytza
Posts: 785
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: A_SpawnParticle... Reogrenized.

Post by Fishytza »

Well, at the moment it's rather inconsistent when compared to other DECORATE functions. (And yes, you're right, it is a moot point, but my OCD screams says otherwise. >_< )

Also...
Graf Zahl wrote:This was meant to be some advance preparation for scripting but Randi chose to do it differently...
Out of curiosity, does this mean all ACTION_PARAM_STARTs will be removed at some point? If yes, then what's the point of using it when making new DECORATE functions?

Return to “Closed Feature Suggestions [GZDoom]”