OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ThEoNeAnDoNlY on 26 Feb 2005, 14:25:20
-
hello, im running this script.
player playmove "Combattomedic"
~5
sandbag setpos [(getpos player select 0)+0,(getpos player select 0)+4,0]
~3
exit
but when the script is activate the sandbag dsnt appear infrontof me, instead it dissapears!!!!!!
Guy
-
Your second select 0 should be select 1
That will then place the sandbag 4 m to the north of the player's posisiton.
-
ok, with that sorted how do i set the FOV of the sandbag?
Guy
-
ok change that, how do i get it so it is infront of me, instead it is always to the north of the player, how do i get it to be set infront of me no matter where i am looking.
guy
-
ok ok ok, im using my old script
~3
_dir = getDir player
_pos = getPos player
; optional direction change of 'bang'
bang setDir _dir
; place infront of the player
bang setPos [(_pos select 0)+(sin _dir), (_pos select 1)+(cos _dir), 0]
~3
but when i do that the sandbag appears at my feet and so the player gets abit stuck, so how do the then add to it to place it 4 ft infront of me
Guy
-
_dist = 2.5
bang setPos [(_pos select 0)+_dist*(sin _dir), (_pos select 1)+_dist*(cos _dir), 0]
-
ok put that and it says:
sandbag setPos [(_pos select 0)+(sin _dir), (_pos select 1)+_dist|#|(cos _dir), 0]
unknown operator
Guy
-
Have you initialised the variable _dist anywhere?
Planck
-
oh no it works now, i forgot to put the > * <
btw what does * mean???
Guy
-
'*' means ........multiply
So 2*2 would mean 2 multiplied by 2
Planck
-
ahh cheers planck, btw does anyone here know how to speed up a;
(count units gr1 == 0) && (count units gr2 == 0)
script? when i put something liekt hat it always takes ages to trigger, so when i clear out a village for example, i am waiting about5 mins until the game realises everyone is dead.
Guy
-
That's because the count command relies on the leader knowing about the unit being dead.
Like when you're playing and you get all the "Oh no, 3 is down" radio messages.
Sometimes it takes a while to trigger.
Try this instead:
(West countside units gr1 == 0) and (West countside units gr2 == 0)
Obviously if the side of the units isn't west then change that to east or resistance ;)