Add translation parameter to all spawning functions

Moderator: GZDoom Developers

User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $

Post by Bio Hazard »

You should just need to type

Code: Select all

svn diff
and it would spit out a patch. I don't know about TSVN though.
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

I generated that patch using TortoiseSVN by right-clicking and "create patch".
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

To developers:

I don't mean to sound annoying or anything but I was wondering what you think about this little feature. Any particular reason this isn't implemented yet?

I mean, I'll understand if it's because I'm still a programming n00b and basically a nobody when it comes to ZDoom development or anything but I thought it was a simple yet useful change that would take a couple of seconds at most to implement.

I'm already using it a lot for special effects in my WADs but I don't really like the fact that I have to stick to a custom EXE for this. I'm sure other modders will find it useful too at one point or another.

After reviewing the initial feature suggestion, I have concluded that the only practical function that needs a translation transfer parameter is A_CustomMissile. So it's pretty much done.

Or maybe you have other plans on how to go about this? A_SpawnItem with an initial horizontal speed? Ability to use an expression for the actor's starting spawn angle? If those two will be implemented, then I guess this modification can be scrapped then.
User avatar
Cutmanmike
Posts: 11346
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

Is this the thing which will make my custom gore "remember" what colour blood the monster has?
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

If you are going to spawn your custom gore sprites using A_CustomMissile, then yes.

Officially, A_SpawnItem and A_SpawnDebris has a translation parameter, but I wanted the blood sprites to fly out. A_SpawnDebris could have been the solution but I wasn't quite happy with the A_SpawnDebris' movement code.

I thought A_CustomMissile would be better since you can put expressions into it and stuff.

It was a simple change to add a translation parameter to A_CustomMissile.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49115
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

I just added a more generic A_SpawnItemEx function which should take care of all your needs.
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

Thank you very much Graf.

If anything, this was a coding lesson for me. ;)

EDIT: Whoa, the new function has 9 parameters. o_O How do I use the other parameters?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49115
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

A_SpawnItemEx(classname, xpos, ypos, zpos, xspeed, yspeed, zspeed, angle, flags)

Both position and speed can be expressed relative to the spawned actor's angle or in global map units.

High flexibility requires a lot of information. You can see what the flags mean by looking at the source. This will be documented when it's officially released.
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Post by Electronic Samurai »

Neat!

Thanks much, Graf.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Holy..... That's awesome! Thanks, Graf!
User avatar
Cutmanmike
Posts: 11346
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

Graf Zahl wrote:A_SpawnItemEx(classname, xpos, ypos, zpos, xspeed, yspeed, zspeed, angle, flags)
Hmm, is the x y z position from the actor that spawns the "item"? Also how would xyz speed work?

Oh yeah, wait for the docs :)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Graf Zahl wrote:Both position and speed can be expressed relative to the spawned actor's angle or in global map units.
User avatar
Cutmanmike
Posts: 11346
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

Oh neat.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49115
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Coordinates are always offsets from the spawning actor. There are 2 modes for both speed and position: relative and absolute.

Relative means that the spawn position and movement direction depends on the spawned actor's angle.
Absolute means the values are differences in absolute map coordinates (e.g. a positive x-value always means 'east'.)
User avatar
Cutmanmike
Posts: 11346
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

So how do you define which uses relative and absolute?

Return to “Closed Feature Suggestions [GZDoom]”