Solved Item spawn position

Question that is answered or resolved.

dantedevil

Well-known member
I have a problem in my mod with the z position of item spawned when destroy certain obtacles.
My mod have some obtacles like the locker, or the container when the strike was broken, but not disappear, to give a more realistic effect.
This obtacles has set in the level an item to spawn.

spawn locker
item coins
coords 250 240
at 0

The problem is sometimes the item is spawned behind the obstacle, and sometimes not. You can get anyway, but not look very well.

It's anyway to set the position for this obstacles?
 
Last edited:
Solution
I don't have any experience with items but I would add a jumpframe to the spawn of the item so when the locker opens the item pops out and lands where you want it.
I don't have any experience with items but I would add a jumpframe to the spawn of the item so when the locker opens the item pops out and lands where you want it.
 
Solution
msmalik681 said:
I don't have any experience with items but I would add a jumpframe to the spawn of the item so when the locker opens the item pops out and lands where you want it.

Great idea my friend!
I try with movez in the spawn animation,  but not work.
Now i try your method,  I got a good feeling about this.
 
There is also script by Bloodbane spawn items like this.  I use it in DOOM for weapon/item drops from enemies.

Code:
void Ispawn(void vName, float fX, float fY, float fZ)
{//Spawns item next to caller.
//
//vName: Spawned item
//fX   : X speed.
//fZ   : Y speed.
//fY   : Z speed.

	void vSpawn = spawner(vName, 0, 0, 0); //Spawn object.

	changeentityproperty(vSpawn, "direction", 1); //Set direction.
      tossentity(vSpawn, fY, fX,fZ); // Toss item.

	return vSpawn; //Return spawn.
}
 
Back
Top Bottom