OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: KyleSarnik on 18 Jun 2003, 02:51:03
-
How do I make a script that adds an "Eject" action to a vehicle (plz don't ask why)
-
put in da init of da vehicle
this addaction ["Eject","eject.sqs"]
now da script wil b
eject.sqs
_man = _this select 0
_veh = _this select 1
unassignvehicle _man
[_man] ordergetin false
but da script may not eject da unit from da veh - i donno cuz i cant test it w/ ur veh :P ;)
LCD OUT
-
that does nothing. I need to make a script where I can add an Eject action to the player unit. I want it to act like a real eject action. It should remove the action after he ejects or gets out or when he is on the ground (its for a chopper)
-
dont chopers have eject action usualy ?
LCD OUT
-
Yea but with DKMs Comanche you cant eject. I think this is because you can't dissembark unless the doors are open.
-
make a trigger which checks for the player being in the chopper:
player in choppername
then on activation
eject = player addaction ["Eject", "eject.sqs"]
now use this script:
player action ["EJECT", choppername]
unassignvehicle player
player removeaction eject
exit
that should work
-
Thx messiah. Works perfectly ;D
Now im going to try to get it to remove the eject action when the chopper is on the ground.
-
make another trigger with condition:
(choppername getpos select 2 == 0)
and then onactivation:
player removeaction eject
not sure about the first line - off the top of my head, but its worth a try :D
-
it should be this messiah
getpos choppername select 2 <=1
-
:-[
-
Why do AddActions sometimes disapear when you board a vehicle?
And then u get out and they are back again :-\
-
hmmm... ive noticed that in reverse...
if u have an addaction added to an object, and u get into a vehicle nearby with that action still in your menu, then the action will remain with you as far as ud rive the vehicle - even if u r no where near the object the action was added to...
ofp bug i think.
-
When a unit boards a vehicle, as far as some things go (eg. actions), the units position remains at the point where it boarded the vehicle.
This is why you have to add actions to a vehicle if you want the player to be able to use them ;)
Also, as far as OFP is concerned the player is still near the object which had the action (which presumably was back where you boarded), so the action remains in your action menu...
If you're killed while riding in a vehicle, do you sometimes notice that the death cam will focus on the position where you boarded the vehicle? It's the same sort of thing ;)
-
:D Oh, Classic...
So you just add the action to the empty vehicle?
I'm gonna give it a whirl ::)
-
Hmm, seems to work fine...
But there is no pleasing some people. lol
If I wanted to make the action appear only when the player is in the vehicle I guess I would have to use this script right?
;Init: [Jeep] exec "Action.sqs"
_Jeep = _this select 0
_Unit = Player
#Start
#Loop
?_Unit in _Jeep : Goto "Action"
~0.5
goto "Loop"
#Action
_Jeep addAction ["Hello", "hello.sqs"]
#LoopB
?!(_Unit in _Jeep) : Goto "RemoveAction"
~0.5
goto "LoopB"
#RemoveAction
_Jeep removeAction 0
Goto "Start"
Wahoooo!! I tested it and it works perfick!! 8) ;D 8)
Please advise me of my scripting errors, I'm still learning.
P.S. How do I use the @ command instead of using stupid Loops
-
Yeah... either that or use a trigger... though:
@? (Player in _Jeep) : Goto "Action"
Should be just:
@ player in _Jeep
and similarily for the next line using @
The @ will wait for the condition specified to be true before moving on to the next line. You shouldn't be using a ? in there ;)
If you wanted to use a trigger, it would look something like this:
Trigger
Radius: 0,0
Condition: none (repeatedly)
Condition Field: (vehicle player) != player
OnActivation Field: (vehicle player) = veh; veh addaction addAction ["Hello", "hello.sqs"]
OnDeactivation Field: veh removeaction 0
-
ah, hehe just noticed this reply... I edited my post
I tried afew combinations with the @ symbol and it didnt work.
I'd like to keep my scripts as small and tidy as possible, does anybody know of a good tutorial? I have used Johan Gustafsson's which taught me everything I know (almost) and Comrefs are very brief.