Home   Help Search Login Register  

Author Topic: Get Damage And Play Music?  (Read 984 times)

0 Members and 1 Guest are viewing this topic.

Captain Winters

  • Guest
Get Damage And Play Music?
« 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
« Last Edit: 06 Apr 2003, 04:26:38 by Captain Winters »

_hammy_

  • Guest
Re:Get Damage And Play Music?
« Reply #1 on: 06 Apr 2003, 05:19:28 »
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:

Code: [Select]
damage = getdammage player
? (damage >= 0.1):playmusic "blubber"

i dont know if the second line is correct...
« Last Edit: 06 Apr 2003, 05:24:22 by HAMMY »

_hammy_

  • Guest
Re:Get Damage And Play Music?
« Reply #2 on: 06 Apr 2003, 05:26:16 »
(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"

Captain Winters

  • Guest
Re:Get Damage And Play Music?
« Reply #3 on: 06 Apr 2003, 05:30:10 »
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

Knut Erik

  • Guest
Re:Get Damage And Play Music?
« Reply #4 on: 06 Apr 2003, 12:22:13 »
I think you must put this in a script....
Not all commands are suported in the editor, so just try that...
 :P

Captain Winters

  • Guest
Re:Get Damage And Play Music?
« Reply #5 on: 06 Apr 2003, 17:47:55 »
 :o ;D I'll give a whack at it Erik! Thanks!

Tanks!  8) ;D :D :)

MorMel

  • Guest
Re:Get Damage And Play Music?
« Reply #6 on: 06 Apr 2003, 19:26:02 »
? getdammage MyUnit > 0.1 : playmusic "signs"

Captain Winters

  • Guest
Re:Get Damage And Play Music?
« Reply #7 on: 06 Apr 2003, 23:23:14 »
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)

Der_Richter

  • Guest
Re:Get Damage And Play Music?
« Reply #8 on: 07 Apr 2003, 00:44:48 »
actually:

if(getDammage _Unit  > 0.1){playmusic "signs"};

is correct. i believe.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Get Damage And Play Music?
« Reply #9 on: 07 Apr 2003, 02:50:17 »
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 ;)

Der_Richter

  • Guest
Re:Get Damage And Play Music?
« Reply #10 on: 07 Apr 2003, 08:31:24 »
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...

Captain Winters

  • Guest
Re:Get Damage And Play Music?
« Reply #11 on: 09 Apr 2003, 23:55:56 »
lol... Thanks for the help guys!   ;D

Tanks 8-)