OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: AshkenaZ on 14 Jun 2005, 13:30:08
-
I need some help..
I'ved used the Addaction command, on a pallet.
My idea is a kind of teleporting, to another pallet there is in the air!.
When a man uses the Action, He should be teleportet to the other pallet.
But it should work for more than one man, at different times.
(It should work on the Man who usses the Action)
How to do ???
I thought of a script there could identify the man who used the Action?
And then use the setpos (Getpos ) command on him!
-
the comref (http://www.ofpec.com/editors/comref.php?letter=A#addAction) has some valuable info on this, depending on which version of flashpoint you're using.
-
If you check the comments in the comref on addAction you will see:
So an example of an action-based script goes like this:
_obj = _this select 0
_man = _this select 1
_index = _this select 2
So add the action to the pallet and when the script is run
_this select 0 will be the pallet and
_this select 1 will be the unit that actions the action
You will need to have the script know which pallet to send him to and it should then be simply be:
_man setPos getPos nameofotherpallet
EDIT: 47 seconds - what was I doing?
-
In simplier words :P
I would try in the pallets init this addaction ["Warp!","Warp.sqs"]
And for the warp.sqs
player setpos [(getpos Name_Of_Floating_Pallet select 0),(getpos Name_Of_Floating_Pallet select 1),(getpos Name_Of_Floating_Pallet select 2)+1]
exit
-
wow, its been a long time since i did this last.
THobson has it right:
in the pallets init, put:
this addaction ["warp","warp.sqs]
warp.sqs:
_warper = _this select 1
_warper setpos getpos pallet_in_the_sky
...like riding a bike :P
-
well, it would be best if it looked like this:
_warper = _this select 1
_warper setpos [(getpos Name_Of_Floating_Pallet select 0),(getpos Name_Of_Floating_Pallet select 1),(getpos Name_Of_Floating_Pallet select 2)+1]
cause if you don't setpos him a bit over the pallet, he most likely will be setposed in the middle of the pallet, and will then fall down.
-
Thx.
It works ;D