OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 29 Mar 2005, 17:40:48

Title: add action
Post by: 456820 on 29 Mar 2005, 17:40:48
how do i add actions and make it play an action then remove the action option
i want an action called Cut parachute.
and make it play one of the hand behind head animations using playmove and switchmove.
then let him drop to the ground from 2 metres high (is that sage)

i have it so he will always land in a small patch of trees then when he is just above the ground i want to set pos him 2 metres high wich i have dont but would that drop him imediatley after if so i can use gotyo "loop"
then i want it to keep looping so he stays 2 metres above ground until the action is performed thean i want him to frop.
i have already dont the set pos in tree ting but none of the rest

EDIT - I have tried it but when im set posed in the air on the loop i seem to die after a second?
Title: Re:add action
Post by: 456820 on 29 Mar 2005, 17:59:57
i had a go like this
1. i had a trigger with west present
condition : this
on activation : [] exec "parachute.sqs"
in parachute.sqs was

Code: [Select]
off1 action ["EJECT", HELO]
[] exec "tree.sqs"

then in tree.sqs was

Code: [Select]
~14
#loop
off1 setpos [getpos off1 select 0, getpos off1 select 1, 2]
hint "Damn i got stuck in a tree. Use the action menu to get back down"
cut = Player addaction ["Cut parachute","cut.sqs"]
?obj5 goto "exit"
goto "loop"
#exit
exit

(i think its seriously wrong)
and then in cut.sqs was

Code: [Select]
~1
obj5
off1 playmove "FXStandSurUniv"
~2
off1 setpos [getpos off1 select 0, getpos off1 select 1, 1]
~0.2
off1 setpos [getpos off1 select 0, getpos off1 select 1, 0]
~0.5
off1 switchmove "null"
~0.5
Player Removeaction cut

the thing is it gave me a load of actions as it is repeating the add action line
and the noise for the hint keeps repeating as it is repeating the hint aswell.

how can i make it so the hint will only show once and the action only shows once but the setpos line keeps repeating until obj5=true
then when it is its lets me down
Title: Re:add action
Post by: Woodpeckersam on 29 Mar 2005, 18:07:05
You know why it gave u loads of ctions of the same things is because you looped it... try it like this

Code: [Select]
~14
hint "d**n i got stuck in a tree. Use the action menu to get back down"
#loop
off1 setpos [getpos off1 select 0, getpos off1 select 1, 2]
?obj5 goto "exit"
goto "loop"
#exit
cut = Player addaction ["Cut parachute","cut.sqs"]
off1 setpos [getpos off1 select 0, getpos off1 select 1, 1]
exit


NOTE* I changed the place where (code) is from your script.

cut = Player addaction ["Cut parachute","cut.sqs"]

and

hint "d**n i got stuck in a tree. Use the action menu to get back down"
you could also name the parachute to for eg para and type in cut.sqs

Code: [Select]
unassignvehicle player
~0.5
player setpos [(getpos para select 0),(getpos para select 1),2]
~0.5
deletevehicle para
Title: Re:add action
Post by: 456820 on 29 Mar 2005, 18:11:42
i manage to have it work fine apart from i die when i am set posed in the tree i wait there a seconf the action and hint shows up but i then die a second later before i have time to cut my self free?
Title: Re:add action
Post by: Woodpeckersam on 29 Mar 2005, 18:14:52
Well i just changed it a bit at my last post...
Title: Re:add action
Post by: RujiK on 29 Mar 2005, 18:44:30
Man! Dont people ever use the search button anymore?!

There are a zillion forums like this...
Title: Re:add action
Post by: 456820 on 29 Mar 2005, 19:50:18
right ive also tried player setdammage 0
in the loop command but it still goes to the screen where it shows your dead even thought your not.

ive also got a feeling this isnt right
?obj5 goto "exit"
Title: Re:add action
Post by: Blanco on 29 Mar 2005, 21:28:09
Quote
?obj5 : goto "exit"
Title: Re:add action
Post by: 456820 on 30 Mar 2005, 09:01:42
thanks i will try that in a bit