Search In
• More options...
Find results that contain...
Find results in...

# Decorate help

## Recommended Posts

Need help, I wanna make a ripple laser projectile, like in Gradius, I'm having difficulty with it, I wanna make them grow, along with the radius and height properties, but I don't know anyway it can be done, another way is to spawn a larger version on the projectile from the smaller version, whilst retaining the angle, velocity, etc, any way this can be done?

I don't think there's any sort of convenient A_SetSize pointer or anything like that that actually affects height/radius, so I would guess your best bet is indeed making a few different versions of the projectile, each one larger than the previous, and they spawn each other sequentially. So if the projectiles' actor definitions were something like this:

```Actor Ball1
Height 1
...

Actor Ball2
Height 2
...

Actor Ball3
Height 3
...

```
... then you could spawn them like this:
```Actor Ball1
...
Spawn:
BAL1 A 4
BAL1 B 4 A_SpawnItemEx("Ball2")
...

```
... and then repeat that for each subsequent actor, until it finally gets to the final, largest version. I would definitely look at A_SpawnItemEx and A_CustomMissile on the ZDoom wiki, as I can't recall which one exactly would be best suited (or work properly) in this situation. Does that make sense? D:

That is exactly what I tried, whilst it DID work, the problem I have, however, is the projectile merely sits there, it doesn't move or anything.

A_SpawnItemEx allows to set the x, y and z velocities of the spawned object. You can transfer the velocities of the spawning object by passing velx, vely and velz to the function:

`A_SpawnItemEx("Something", 0, 0, 0, velx, vely, velz)`

For reference: http://zdoom.org/wiki/DECORATE_expressions#Variables

A_SpawnItemEx allows to set the x, y and z velocities of the spawned object. You can transfer the velocities of the spawning object by passing velx, vely and velz to the function:

`A_SpawnItemEx("Something", 0, 0, 0, velx, vely, velz)`

For reference: http://zdoom.org/wiki/DECORATE_expressions#Variables

Would it have the same angle, pitch, velocity as the thing that spawned it?

Yes, it would have the same angle, pitch and velocity. I'm not entirely certain if there wouldn't be other side effects, though (for example impact/collision-detection related ones), as projectiles are generally supposed to be fired by A_CustomMissile rather than A_SpawnItemEx.

scifista42 said:

Yes, it would have the same angle, pitch and velocity. I'm not entirely certain if there wouldn't be other side effects, though (for example impact/collision-detection related ones), as projectiles are generally supposed to be fired by A_CustomMissile rather than A_SpawnItemEx.

Just tried them, it works for sure, but with a nasty side effect. The second projectile will go to one angle, never a different one.

http://zdoom.org/wiki/A_SpawnItemEx

Try different flags. SXF_ABSOLUTEVELOCITY sounds like it might be what you need.

Salahmander2 said:

Would it have the same angle, pitch, velocity as the thing that spawned it?

http://zdoom.org/wiki/A_SpawnItemEx

Angle is transferred automatically, but you'll need SXF_TRANSFERPITCH for transferring pitch. For velocity, see what scifista said.

Is it really needed to transfer pitch as the thing's property when you already transfer its Z velocity? It shouldn't affect the projectile's appearance or behavior, or does it?

It depends. A projectile's pitch might be used for various purposes (such as shooting subprojectiles with more A_SpawnItemEx calls and using pitch variable) and it can also be used for cosmetic reasons (e.g., when using a model, with INHERITACTORPITCH in MODELDEF).

If you're not planning on doing anything of the sort, the pitch value is pretty much pointless for anything that isn't a player pawn; but he did mention he wanted to transfer pitch, so whether there's a good reason for that or not, I mention how pitch can be transferred.

scifista42 said:

http://zdoom.org/wiki/A_SpawnItemEx

Try different flags. SXF_ABSOLUTEVELOCITY sounds like it might be what you need.

OMG! That's the one! Thank you very much! :D