How to Make One Projectile Spawn Centered
From EDukeWiki
You probably have seen that when some actor shoot the projectile looks like to come from right hand (excluding hard-coded actor like BOSS3). Here is the code to make the projectile spawn centered.
Gamevars:
gamevar X 0 0 gamevar Y 0 0
Add at actor code before the shoot command:
getactor[THISACTOR].x X getactor[THISACTOR].y Y shoot RPG
After use the event EVENT_EGS (it assumes that the actor shooting is MYENEMY):
onevent EVENT_EGS ifactor RPG ifspawnedby MYENEMY { setactor[THISACTOR].x X setactor[THISACTOR].y Y } endevent
You also can use z coordinate togheder with x and y, but probably in a common enemy wich uses cstat as bocked, the projectile will come from his "feets" and hit himself.