Home   Help Search Login Register  

Author Topic: hands up  (Read 716 times)

0 Members and 1 Guest are viewing this topic.

headshot_snipe

  • Guest
hands up
« on: 08 Apr 2003, 18:01:04 »
when i want a guy with his hands on his head i usually use triggers, but it takes ages so i "tryed" to make a script, but since my scripting skills are not very good the thing i made doesn't work.

1.            I was trying to make a script so that when i type in the name or names of the units they all put their hands behind their heads and in case they die the animation "effectstandsurdead" comes up. here is my script:

guy = this select 0

guy setbehaviour"SAFE"

guy switchmove"effectstandsur"

#loop

?not(alive guy) = guy switchmove"effectstandsurdead"

goto"loop"

exit

Is their smth wrong in there? why doesn't it work?

2.            in some scripts i found on the net they have the following line: [whatever,whatever] exec "whatever.sqs" to activate the script.

how do you use those []?

thanks in advance


Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:hands up
« Reply #1 on: 08 Apr 2003, 18:33:07 »
This is how you should do:

_guy = _this select 0

_guy setbehaviour"SAFE"

_guy switchmove"effectstandsur"

@not(alive guy) : _guy switchmove"effectstandsurdead"

exit



2. [] is the cant-remember-the-name-cause-I-suck-on-names. Anyway, you see this in your script?

_guy = this select 0

Right? Well, IÂ'll make an example for this script.

[TheGuyYouWantToPutHisHandsBehindHisHeadName] exec "HandBehind.sqs"

Do you understand? _guy = this select 0 means that the user can put in sumthin in the [].

Man, I gotta start learning names :).
« Last Edit: 08 Apr 2003, 18:33:35 by The real Armstrong »

headshot_snipe

  • Guest
Re:hands up
« Reply #2 on: 09 Apr 2003, 13:43:01 »
thanks very much for the reply. just one other question:

what does the underscore do before the "guy" and the "this", cant you just write it as guy = this select 0?


mikeb

  • Guest
Re:hands up
« Reply #3 on: 09 Apr 2003, 15:19:44 »
the underscore refers to local variables that work within the cript.  if you've named the guy as guy in the editor then it may work but the _this refers to the script that was called.  if you use it without the underscore it won't know which "this" you're refering to

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:hands up
« Reply #4 on: 09 Apr 2003, 15:55:15 »
I recommed you read Gustavssons script tute. Real swedish quality :).

headshot_snipe

  • Guest
Re:hands up
« Reply #5 on: 09 Apr 2003, 16:59:52 »
Er.... i tried the script and it doesn't work, it displays a error message:

'  not(alive _guy) [ # ] : _guy switchmove"effectstandsurdead"  ': error unknown operator

i dont get it... do you have any idea whats wrong?




 
« Last Edit: 09 Apr 2003, 17:03:49 by headshot_snipe »

headshot_snipe

  • Guest
Re:hands up
« Reply #6 on: 09 Apr 2003, 17:35:16 »
do not worry, i found it out (after reading Johan Gustafsson's tute) the script should have looked like this:

_guy = _this select 0

~5

_guy switchmove"FXstandsur"

#update

? not(alive _guy) : goto"dead"

goto"update"

#dead

_guy switchmove"FXstandsurdead"

exit

thanks for your replies anyway.





« Last Edit: 09 Apr 2003, 17:41:08 by headshot_snipe »