how to spawn entity at position of level (not screen position)

DonoVane

New member
The manual says:

coords {x} {z} {a}
  • {x} is relative to the screen's current position, NOT the actual position in terms of the level itself.
So how then do I make an entity spawn at a certain position regardless of the current screen's position?

Example: I let an enemy come out of a doorway in the wall above where the player spawns after 1 second. If the player moves left or right before the enemy appears, the enemy should still appear as if coming from the doorway.
 
Solution
You need to apply this kind of script to force certain coords.
Code:
spawn    Enemy
@script
void main()
{
    void self = getlocalvar("self");

    changeentityproperty(self,"position", 700);
}
@end_script
alias    Jake
health    100
coords    520 400
at    0

This enemy will spawn at x = 700 and z = 400 regardless of scrolling position.
You need to apply this kind of script to force certain coords.
Code:
spawn    Enemy
@script
void main()
{
    void self = getlocalvar("self");

    changeentityproperty(self,"position", 700);
}
@end_script
alias    Jake
health    100
coords    520 400
at    0

This enemy will spawn at x = 700 and z = 400 regardless of scrolling position.
 
Solution
Back
Top Bottom