Home   Help Search Login Register  

Author Topic: Animation script  (Read 1428 times)

0 Members and 1 Guest are viewing this topic.

Dubieman

  • Guest
Animation script
« on: 08 Jul 2004, 20:43:01 »
In my SF mission the guards will be talking and looking around not staring blankly at one another since the SF guy is supposed to be sneaky. The only problem is I can't code the loop and arguement right.

I have a trigger that is east detected by west and it is a switch trigger that alerts ppl at the outpost. In the activation field I put "trig1done = true".

Now I want my script of animations to loop but if the true/false deal is true then I want the switchmoves to go null and set the guy to DANGER.

Here's my script.


************************************
_m = _this select 0

#loop
m switchmove "EffectStandTalk"
~8
m switchmove "FXCivilFoldOnesArms"
~14
m switchmove "FXCivilLookback"
~9
m switchmove "FXCivilArmsAkimboL"
~10
;not sure about the arguement here
?(trig1done = true) goto : #arm
goto : #loop

#arm
m switchmove "null"
m setbehaviour "DANGER"
exit

**********************************
Any help appreciated and any sugestions on the animations is welcome. :)



« Last Edit: 08 Jul 2004, 20:44:54 by GuiltyRoachKilla »

ponq

  • Guest
Re:Animation script
« Reply #1 on: 08 Jul 2004, 20:53:11 »
Code: [Select]
?(trig1done = true) goto : #armthis line should look like this:
Code: [Select]
?(trig1done = true): goto "arm"
Also, consider using Playmove instead of switch move. It looks much better.

And remember that for switch and playmove the units often need to be in safe mode. Otherwise the fx won't be triggered.

I'd also add a check between each fx to see if the unit isn't under fire, it would look rather stupid to stand with folded arms while yer head is being shot off...;)

you could prolly check if the unit is in safe mode, and if not, exit the script or skip the animations and have a delay before checking if the unit is still not safe.

More advanced is using an array with stored playmoves which get picked randomly. See Macguba's post about nature and wildlife, extinct animals and dinosaurs and things like that (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=18363 "can't see wood for trees") from today at this section of the forum for an example.
« Last Edit: 08 Jul 2004, 20:56:34 by ponq »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Animation script
« Reply #2 on: 08 Jul 2004, 21:23:31 »
Perhaps make the loon setCaptive true so nobody shoots at him.    

ponq is half right, but try

? trig1done : goto "arm"

Remember,

= sets something equal to something else
== checks if two things (e.g. numbers) are the identical
if the variable is boolean you just need the variable itself
Plenty of reviewed ArmA missions for you to play

Dubieman

  • Guest
Re:Animation script
« Reply #3 on: 08 Jul 2004, 21:38:59 »
I can't have the loon be setcaptive true. It's just you and two other spetz natz that you controll and lead. The enemy force well is the enemy.

I dunno. If the trig1done = true is activated in the script the guy goes to danger mode and make the switchmove animations go null. The trigger itself will send the soldier on to his next waypoints the seek and destroy with a cycle on it it. Hopefully foolproof.

Anyways so you were thinking the script should look like this?

**************************************
 _m = _this select 0

#loop
m switchmove "EffectStandTalk"
~8
m switchmove "FXCivilFoldOnesArms"
~14
m switchmove "FXCivilLookback"
~9
m switchmove "FXCivilArmsAkimboL"
~10
;not sure about the arguement here
? trig1done = true goto : "arm"
goto : "loop"

#arm
m switchmove "null"
m setbehaviour "DANGER"
exit
***********************************

trig1 being the detected trigger.
Is this what you were thinking? I'll try it in a few minutes to see.

I didn't really look at your post Macguba on your own script. That might help in my mission.  :P :)
« Last Edit: 08 Jul 2004, 21:39:34 by GuiltyRoachKilla »

Dubieman

  • Guest
Re:Animation script
« Reply #4 on: 08 Jul 2004, 21:40:42 »
Ohh yea and I'm not sure, but some of the animations didn't work with playmove...

ponq

  • Guest
Re:Animation script
« Reply #5 on: 08 Jul 2004, 21:47:57 »
why remove the underscore?

Code: [Select]
_m = _this select 0

#loop
_m switchmove "EffectStandTalk"
~8
_m switchmove "FXCivilFoldOnesArms"
~14
_m switchmove "FXCivilLookback"
~9
_m switchmove "FXCivilArmsAkimboL"
~10
;not sure about the arguement here
? trig1done: goto "arm"
goto  "loop"

#arm
_m switchmove "null"
_m setbehaviour "COMBAT"
exit

Things changed:
-added the underscore to m => _m
-when pointing to a bookmark in the script use goto "bookmark".  (not as you did goto : "bookmark")
-setbehaviour combat instead of Danger.
-included macguba's correction => ? trig1done: goto  "arm"

___
and yes sometimes playmove doesn't work.
« Last Edit: 08 Jul 2004, 21:49:21 by ponq »

Dubieman

  • Guest
Re:Animation script
« Reply #6 on: 08 Jul 2004, 22:03:23 »
The guy is called m and it still worked without the underscore, I'll leave it in there.

Thanks for the updated script. I'll definatly test it now.

:thumbsup:

Dubieman

  • Guest
Re:Animation script
« Reply #7 on: 13 Jul 2004, 03:35:42 »
Bahh I say to my script. :P

I've finally gotten a regular time to test it and its frought with bugs all over! :(

But they are easy methinks to solve for you better scriptors out there. ::)

Code: [Select]
_m = _this select 0
;
#talk
m switchmove "EffectStandTalk"
~14
? trig1done = true goto : "arm"
~0.5
m switchmove "FXCivilFoldOnesArms"
~6
? trig1done = true goto : "arm"
~1
m playmove "FXCivilLookback"
~5
? trig1done = true goto : "arm"
~1
m switchmove "FXCivilArmsAkimboL"
~8
? trig1done = true goto : "arm"
~0.5
m switchmove "EffectStandTalk"
~8
? trig1done = true goto : "arm"
~0.5
goto "talk"
;here is the end where the guy should arm himself
#arm
m switchmove "null"
m setbehaviour "COMBAT"
exit


Anyways I get many errors with the arguements saying the error the goto is not valid or present or something. I'm not sure what the problem is. ???

I put in the same arguement over and over again to avoid the problem of the guy having to go through the whole list before being able to arm himself. I've found a bug though and think that I should also add another arguement so that if he dies the script doesn't keep going and it immediatly ends. I've seen him repeatedly rise from the dead.... :-\ :P

As for the dead part I know I have to add the NOT ALIVE m = goto "exit", but I want to fix the first problem first.
Take it one at a time. ;)

By the way once #arm is triggered by the trig1done =true the guy m goes to his seek and destroy waypoint. The trig1 is a detected by waypoint so all should go well after the script. Jeez I keep adding and adding things to this post.:joystick:

Help is appreciated as this would make my mission a little better. ;) :P :P :)
« Last Edit: 13 Jul 2004, 03:39:02 by GuiltyRoachKilla »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Animation script
« Reply #8 on: 13 Jul 2004, 12:06:30 »
I'm not sure what the problem is either.   What's going wrong?   If you're getting an error message quote it exactly.
Plenty of reviewed ArmA missions for you to play

Dubieman

  • Guest
Re:Animation script
« Reply #9 on: 13 Jul 2004, 15:31:45 »
I'll try but it appears and dissappears quickly...

Ahh here it is:

trig1done = true l#lgoto : unknown operator goto

 :P
Not exactly sure what it means but the # is supposed to have straight line going down on either side of it so I used lower case Ls.


PsyWarrior

  • Guest
Re:Animation script
« Reply #10 on: 13 Jul 2004, 16:03:58 »
Greets,

Er... GRK, the problem has been solved. Look at the previous posts.

Your script:

? trig1done = true goto : "arm"

Fixed script:

?trig1done: goto "arm"

1. You do not need a colon (:) between goto and "arm".
2. You do need a colon after the condition (?trig1done) and the result (goto "arm".
3. OFP will not accept the condition ?trig1done=true. Instead, just use ?trig1done. The condition ?trig1done will only trigger if the variable trig1done is true.

NB: you will also need to place the line
trig1done = false
in your init.sqs.

-Supr. Cmdr. PsyWarrior
-Psychic Productions

Dubieman

  • Guest
Re:Animation script
« Reply #11 on: 13 Jul 2004, 16:51:47 »
Jeez I'm horrible at seeing the little things...
Ahh well thanks for pointing that out to me.  :-[ :P

I already put in the trig1done = false in my init.sqs but I never knew you could do

?trig1done: goto "arm"

I always thought it needed the true part. Shows how much I still need to learn.

Thanks all for your help, I'm pretty sure this will work. If not you know where I'm gonna post. ;)

PS: ohh yeah I need to add the death parts to. I'll be back later anyways... :P ::)

PsyWarrior

  • Guest
Re:Animation script
« Reply #12 on: 13 Jul 2004, 16:59:20 »
Quote
If not you know where I'm gonna post.

PS: ohh yeah I need to add the death parts to. I'll be back later anyways...
We'll be here. Or... Someone will anyway ::) :P

*Thinks...Have to get life...*

And BTW, the |#| symbol in error messages indicates where the error is. For example:

player |#| setdammmmage 1 (that's an ERROR: Unknown operator setdammmmage)

And in the above case:

trig1done = true l#lgoto : unknown operator goto
It simply means that the word goto next to the |#| symbol should not be there, or makes no sense... :P

-Supr. Cmdr. PsyWarrior
-Psychic Productions

Dubieman

  • Guest
Re:Animation script
« Reply #13 on: 13 Jul 2004, 20:29:09 »
Sorry to bother you ppl all over again, its the last time I swear. :D ;D

But I have everything working right now, but my death part needs one little piece to work and I'm not sure what it is...

Code: [Select]
_m = _this select 0

#talk
m switchmove "EffectStandTalk"
~14
?trig1done: goto "arm"
;here is where I get an #error on the m part
NOT ALIVE m: goto "exit"
~0.5
m switchmove "FXCivilFoldOnesArms"
~6
?trig1done: goto "arm"
~1
m playmove "FXCivilLookback"
~5
?trig1done: goto "arm"
~1
m switchmove "FXCivilArmsAkimboL"
~8
?trig1done: goto "arm"
~0.5
m switchmove "EffectStandTalk"
~8
?trig1done: goto "arm"
~0.5
goto "talk"

#arm
m switchmove "null"
m setbehaviour "COMBAT"
exit

And I plan on dispersing the death part all over next to the trig1done arguements.

Thanks for answering...
« Last Edit: 13 Jul 2004, 20:30:41 by GuiltyRoachKilla »

Dubieman

  • Guest
Re:Animation script
« Reply #14 on: 14 Jul 2004, 03:25:58 »
Sorry I should elaborate.

The

NOT ALIVE m: goto "exit"

does not work and I think its a simple syntax error I've been stuck on. I tried a Q mark in front and just ?alive m but it gives me errors saying "m" is not supposed to be there.

Thanks

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Animation script
« Reply #15 on: 14 Jul 2004, 09:05:00 »
not alive is one of the command OFP doesn't like without brackets for some reason...

Try:

? not (alive m): goto "exit"

And see if you have any joy ;)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Animation script
« Reply #16 on: 14 Jul 2004, 15:56:17 »
Nah Sui, it's not the brackets missing - ofp can handle that
without any brackets, but it's a question mark missing.

You even posted the correct version Sui  ;)

~S~ CD

Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Dubieman

  • Guest
Re:Animation script
« Reply #17 on: 14 Jul 2004, 19:05:43 »
Ahh okay it was the ?. It should work now and if it doesn't I'll try brackets or something else....

Thanks guys. ;)

I thought just plain not alive would work cause I've used it in condition fields before without the question mark. :P

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Animation script
« Reply #18 on: 15 Jul 2004, 08:19:40 »
Bahaha... ;D

Not enough caffinee today to be answering complicated editing questions involving question marks...

DBR_ONIX

  • Guest
Re:Animation script
« Reply #19 on: 15 Jul 2004, 13:45:33 »
If that doesn't work, you could try something like :
Code: [Select]
?(m dammage==0):ExitI, uh, think..
- Ben

DBR_ONIX

  • Guest
Re:Animation script
« Reply #20 on: 15 Jul 2004, 13:49:29 »
Code: [Select]
_m = _this select 0

#talk
m switchmove "EffectStandTalk"
~14
?trig1done: goto "arm"
;here is where I get an #error on the m part
NOT ALIVE m: goto "exit"
~0.5
m switchmove "FXCivilFoldOnesArms"
~6
?trig1done: goto "arm"
~1
m playmove "FXCivilLookback"
~5
?trig1done: goto "arm"
~1
m switchmove "FXCivilArmsAkimboL"
~8
?trig1done: goto "arm"
~0.5
m switchmove "EffectStandTalk"
~8
?trig1done: goto "arm"
~0.5
goto "talk"

#arm
m switchmove "null"
m setbehaviour "COMBAT"
exit

Just noticed something in that code....
First line : "_m = _this select 0"
Then the rest fo the code, you use the name "m"

It won't work with more than one person, unless you change all the "m"s to "_m"
::)
If it does work, I guess the person your running the script on it called "m"?

::)
- Ben