OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Winters on 06 Apr 2003, 02:45:02
-
;D ;DWell I have a problem. You see i have a small piece of code inside of a trigger that reads:
(sn) getDammage if > 0.1 == playMusic "signs"
Now this doesn't work... Can you help me out with this? What I need is a little script that starts to play music once this guy's (sn) dammage is greater than 0.1? Help? Please? I know there's tons of scripting smarties out there! 8) ;D
Tanks! 8) ;D
-
I dont really know how to use the getdammage command, but if you could tell me what error you get when you run that line, then maybe I could help you.
EDIT:
after looking at the command reference...
you could maybe try this:
damage = getdammage player
? (damage >= 0.1):playmusic "blubber"
i dont know if the second line is correct...
-
(sn) getDammage if > 0.1 == playMusic "signs"
found a little error in that line.
it should be (if thats how you use getdammage...?)
(sn) getdammage if > 0.1:playmusic "signs"
-
Damn, for all of the errors I get an "Unknown Operator"... Lemme See. G2 jet to bed. Nighty night, i'll sleep on it... PLEASE HELP! 8) :o ??? :-\ :-[
Tanks! :o 8) ;D
-
I think you must put this in a script....
Not all commands are suported in the editor, so just try that...
:P
-
:o ;D I'll give a whack at it Erik! Thanks!
Tanks! 8) ;D :D :)
-
? getdammage MyUnit > 0.1 : playmusic "signs"
-
Mhm. That doesn't work either. Thanks thouigh guys. I found a work around for my problem! Thanks for the help! You're all going into the credits! 8) ;D
Tanks! 8)
-
actually:
if(getDammage _Unit > 0.1){playmusic "signs"};
is correct. i believe.
-
LOL! ;D
The only correct syntax in this whole thread has been in MorMel's post :)
Not trying to put anyone down here, but all you need to do is check out the official command reference if you're after correct syntax.
You can do this using either a trigger:
Trigger
Radius: 0,0
Condition Field: (getdammage unit) > 0.1
OnActivation Field: playmusic "signs"
or with scripting commands:
- ? getdammage unit > 0.1 : playmusic "signs" (already mentioned)
- if (getDammage _Unit > 0.1) then {playmusic "signs"}
Sorry guys, I probably shouldn't have stuck my oar in here. It just frustrates me to see someone with a question getting (slightly) wrong advice.
Not meaning to rub anyone up the wrong way, I'm sure as hell not god's gift to scripting... ;D
But if you are ever in doubt about syntax, all you need to do is have a quick peek at the Official Command Reference ;)
-
hehe. no need to worry. i forgot to put "then" in. i wrote this up about 00:30 AM, here, after a days work... hehe. kinda gets that way some times. itÂ's good to get it pointed out for u when u forget something...
-
lol... Thanks for the help guys! ;D
Tanks 8-)