Home   Help Search Login Register  

Author Topic: Playmove not working as I like  (Read 395 times)

0 Members and 1 Guest are viewing this topic.

ponq

  • Guest
Playmove not working as I like
« on: 05 Jun 2004, 11:45:00 »
Hello.

I'm using GAMEER's addon to have some resistance guys smoking a cigaret around a fire. This smoking addon requires (afaik) the lads to stand while smoking, but since they are having a relaxed night, they are sitting around the fire.

So here's what I want:
Start sitting.
After a while, stand up, smoke, sit back down.

I use this script for it, called from the units init line:

Code: [Select]
;smoking script by ponq for use with GAMEER's smoking addon

_unit = _this select 0

~0.1

#loop

~ 10 + (random 60)

;tell the sitting unit to stand up, since smoking addon requires

standing soldier
hint "opstaan"
_unit Playmove "SitDownToStand"

~4


;unit needs to feel SAFE to actually smoke.
?(behaviour _unit != "SAFE"):exit

hint "roken"
_unit playmove "GME_Smoke"
~23.5

_unit Playmove "Null"

;sit unit back down
hint "weer zitten"
_unit Playmove "Effectstandsitdown"
~4

goto "loop"
exit

The hints show me in game which phase the script is in, they read "stand up", "smoke", and "sit down" in dutch ;)

The problem:
The lazy resistance bastards refuse to sit down after their smoke. They do continue the loop, so they are smoking a lot... but they don't do the sit down playmove.

I've used the playmove "null" to try to 'reset' the playmove stuff, didn't work.

I've tried to search the forum about this, couldn't find what I need.
Plz enlighten me, thanks.

ponq

  • Guest
Re:Playmove not working as I like
« Reply #1 on: 05 Jun 2004, 12:27:17 »
I've also tested this without the smoke moves. The solds do sitdown in that case.

So, maybe the smoke move needs more time. I exprimented with it, but no change.

If they smoke they stay 'high' forever ;)

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Playmove not working as I like
« Reply #2 on: 05 Jun 2004, 13:31:44 »
try switchmove
Not all is lost.

ponq

  • Guest
Re:Playmove not working as I like
« Reply #3 on: 05 Jun 2004, 14:31:51 »
Thanks for your reply.

I tried Switchmove but at first it did work...but not as I wanted. The soldier would instantly sit down (doh...it's switchmove ;) ). But with some experimenting I found this:

Here's the trick which worked out for me.

Use switchmove to *end* the smokingFX, and use playmove with standsitdown. The transition from smoking to endsmoking is smooth despite using swithmove instead of playmove, cos there's only a small difference in stance.

I replaced the last part of code with this:

Code: [Select]
hint "roken"
_unit playmove "GME_Smoke"
~23.5

_unit switchmove "GME_SmokeEnd"

~6

;sit unit back down
hint "weer zitten"
_unit playmove "Effectstandsitdown"
~4

goto "loop"
exit

Thanks artak for triggering this ;)
« Last Edit: 05 Jun 2004, 14:35:27 by ponq »