Mav3r1ck, on 28 November 2018 - 06:47 PM, said:
onevent EVENT_GAME
ifspawnedby APLAYER
ifactor RPG
spawn SMALLSMOKE
sizeat 7 7
endevent
If I'm correct, this code is telling the game that Duke will fire the RPG with a thin smoke trail. The goal was to have it to where the Devastator rockets fired with a thin smoke trail. However, this will cause the larger rockets fired by the RPG to also have thin smoke trails. I'm trying to get it to where the Devastator will fire rockets with thinner smoke trails while the RPG fires rockets with the default smoke trails it comes with.
Some changes:
appendevent EVENT_GAME
ifactor RPG
ifspawnedby APLAYER
ife sprite[].xrepeat 7
{
espawn SMALLSMOKE
seta[RETURN].xrepeat 7
seta[RETURN].yrepeat 7
}
endevent
Use "appendevent" because that will ensure it adds code to the event even if there are "onevent" or "appendevent" for it elsewhere. Note I am checking the size of the rocket. Rockets fired by the devistator are 7x7, and no other rockets in the game are that size. You don't even need the "ifspawnedby APLAYER" because the size should pick them out even without that. Super important: In CON, indenting does nothing, it's just for readability. So in your code, your "sizeat 7 7" was setting size on the RPG that is running the code, not on your spawned smoke. To set it on the thing you are spawning, you can use "espawn" which sets RETURN as the handle on the new sprite. Then you explicitly set size on the x/y repeat of the target sprite. Also note my use of { }

Help
Duke4.net
DNF #1
Duke 3D #1


