Home   Help Search Login Register  

Author Topic: If unit is damaged, proceed to "Loop"  (Read 1112 times)

0 Members and 2 Guests are viewing this topic.

Offline Arctic

  • Members
  • *
  • In Utero
If unit is damaged, proceed to "Loop"
« on: 09 Jun 2003, 16:42:25 »
Code: [Select]
?(damage player >= 0.5): goto "vehiclecam"

This line is producing an error saying it doesnt know who player is. Can someone tell me what the error is?

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:If unit is damaged, proceed to "Loop"
« Reply #1 on: 09 Jun 2003, 16:54:10 »
It should be "getdammage" rather than "damage"

Thus :

Code: [Select]
? (getdammage player >=.5):goto "vehicleloop"
« Last Edit: 09 Jun 2003, 16:55:38 by Igor Drukov »

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:If unit is damaged, proceed to "Loop"
« Reply #2 on: 09 Jun 2003, 18:58:49 »
That's not true.  damage is the same as getdammage.

Your code looks good to me, Arctic.  Not that I think it'll work, but see what happens if you use a local variable in the script instead.  E.g.:

Code: [Select]
_unit = player

? (damage _unit >= 0.5) : goto "vehicleloop"

I don't think it'll fix the problem, but it's something to try since I otherwise don't see what's wrong with your code.
Ranger

Babalon

  • Guest
Re:If unit is damaged, proceed to "Loop"
« Reply #3 on: 09 Jun 2003, 19:40:19 »
I do believe your porblem is not defining your player.

Make sure he has a name (IE Bob, or E12, whatever).

In your script, change it to... (I use getdamage)

?((getdamage _this) >= 0.5) : goto "vehicleloop".


Also, just to make sure you know.  "?" are used to check something when the script is run, and return either true or false.  "@"s are triggers, that wait until the condition is true before continueing onward with the script, or continued to a defined (goto) part of the script.

Also there is one last way to fix you script.  Put this up top.

player = _this

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:If unit is damaged, proceed to "Loop"
« Reply #4 on: 09 Jun 2003, 19:41:45 »
You're totally right, Ranger, my mistake :P

Just a reminder, though : "damage" works with version 1.5.

*edit*

As a work-around, you could just give the player-unit a name, and use that name in the script.



« Last Edit: 09 Jun 2003, 19:43:31 by Igor Drukov »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:If unit is damaged, proceed to "Loop"
« Reply #5 on: 09 Jun 2003, 21:23:35 »
wat is da whole script nywayz ?

mebe oder thing make it prob in dat line ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:If unit is damaged, proceed to "Loop"
« Reply #6 on: 09 Jun 2003, 21:52:04 »
I was under the impression that he was using player as in the reserved global variable that is equal to the player of a particular computer.  Maybe not.
Ranger

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:If unit is damaged, proceed to "Loop"
« Reply #7 on: 09 Jun 2003, 21:59:40 »
you can use "player" in ANY single-mission script without probs  :)


Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:If unit is damaged, proceed to "Loop"
« Reply #8 on: 09 Jun 2003, 22:02:35 »
try this:

Code: [Select]
? getDammage player >0.5: goto "loop"
or:

Quote
? (getDammage player >0.5): goto "loop"

...if ya like. both ways work just fine!  :)

So if you STILL have probs, it's not from this end, as LCD said

Babalon

  • Guest
Re:If unit is damaged, proceed to "Loop"
« Reply #9 on: 09 Jun 2003, 22:27:13 »
Lets see how many OFPEC Script guys it takes to solve a simple "getdamage" line in a script  ::)

I'm going to laugh if in the end all of us are wrong, and its something completely different.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:If unit is damaged, proceed to "Loop"
« Reply #10 on: 09 Jun 2003, 23:13:26 »
@ baba (dat meens father in arabic ::) ;D)

usualy ? it takes 10 OFPEC scrolers ;) nd it takes more n 3 pages  :o  ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Babalon

  • Guest
Re:If unit is damaged, proceed to "Loop"
« Reply #11 on: 09 Jun 2003, 23:53:19 »
I'd hate to see what happens if a light bulb would go out here.

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:If unit is damaged, proceed to "Loop"
« Reply #12 on: 10 Jun 2003, 00:38:07 »
her you go try this

gunnerkilled.sqs
Code: [Select]
? (getDammage pl1 >0.5): goto "alive"
? (getDammage pl2 >0.5): goto "alive1"
? (getDammage pl3 >0.5): goto "alive2"
? (getDammage pl4 >0.5): goto "alive3"
? (getDammage pl5 >0.5): goto "alive4"
? (getDammage pl6 >0.5): goto "alive5"
? (getDammage pl7 >0.5): goto "alive6"
? (getDammage pl8 >0.5): goto "alive7"



#alive
pl1 setDammage 0
pl1 moveingunner mg1
#alive1
pl2 setDammage 0
pl2 moveingunner mg2
#alive2
pl3 setDammage 0
pl3 moveingunner mg3
#alive3
pl4 setDammage 0
pl4 moveingunner mg4
#alive4
pl5 setDammage 0
pl5 moveingunner mg5
#alive5
pl6 setDammage 0
pl6 moveingunner mg6
#alive6
pl7 setDammage 0
pl7 moveingunner mg7
#alive7
pl8 setDammage 0
pl8 moveingunner mg8

Offline Arctic

  • Members
  • *
  • In Utero
Re:If unit is damaged, proceed to "Loop"
« Reply #13 on: 10 Jun 2003, 00:44:18 »
Thanks for responding guys!  ;D It was just the spelling mistake. That line was like the trigger to a cutscene.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:If unit is damaged, proceed to "Loop"
« Reply #14 on: 10 Jun 2003, 00:46:49 »
ROFL

solve da prob

LCD OUT

« Last Edit: 10 Jun 2003, 00:47:27 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta