Home   Help Search Login Register  

Author Topic: Cancelling playmove/switchmove  (Read 2490 times)

0 Members and 1 Guest are viewing this topic.

Offline Arctic

  • Members
  • *
  • In Utero
Cancelling playmove/switchmove
« on: 10 Feb 2003, 01:10:28 »
In the beginning of a script, I tell some units to sit down. But when the player is close to them, they will stand up and attack the player. The problem is, I can't get the units to stand up!

Code: [Select]
_unit = _this select 0
_marker = _this select 1

#Sit
[_unit] exec "distance.sqs"
?(distamount <= 5): goto "posPlayer"

_unit playmove "EffectStandSitDown"
goto "Sit"

#posPlayer
_marker setpos [getpos player select 0,getpos player select 1,1]
#alert
?((_unit distance _marker) <= 5): goto "Patrol"
?(!alive player): exit
?(!alive _unit): exit
_unit switchmove "SitDowntoStand"

_unit setcombatmode "RED"
_unit setbehaviour "Combat"

_unit commandmove getpos _marker

~4
goto "alert"

#Patrol
?(!alive player): exit
?(!alive _unit): exit
?(!_unit knowsabout player): exit
_unit doTarget player
_unit commandMove getpos player

~7
_aa = random 20
_ab = random 20
_unit setvelocity [_aa,0,_ab]

~7
goto "patrol"

Side note: Some of that code is a little bad b/c I couldn't think of what to do with it.

What command do I issue to get these guys to attack me.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #1 on: 10 Feb 2003, 01:17:02 »
From what I gather about your script, is that you tell them to target and attack but they remain sitting still?  As you ask, you need to tell them to stop switchmoving.

UnitName SwitchMove ""

Will do it nicely.  Alternatively you can use Playmove if you want a  smother animation.

Offline Arctic

  • Members
  • *
  • In Utero
Re:Cancelling playmove/switchmove
« Reply #2 on: 10 Feb 2003, 01:22:04 »
sweet

thx

Offline Arctic

  • Members
  • *
  • In Utero
Re:Cancelling playmove/switchmove
« Reply #3 on: 10 Feb 2003, 01:38:42 »
Didn't work....  >:(

Code: [Select]
_unit = _this select 0
_marker = _this select 1

#Sit
[_unit] exec "distance.sqs"
?(_unit knowsabout player): goto "posPlayer"

_unit playmove "EffectStandSitDown"
goto "Sit"

#posPlayer
_marker setpos [getpos player select 0,getpos player select 1,1]
#alert
?(!alive player): exit
?(!alive _unit): exit

_unit switchmove ""
_unit setcombatmode "RED"
_unit setbehaviour "Combat"

_unit commandmove getpos _marker

~4
?((_unit distance _marker) <= 1.5): goto "Patrol"
goto "alert"

thats just the portion of it that concerns the switchmove/playmove of the unit.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #4 on: 10 Feb 2003, 01:49:59 »
So whats happening?  The _unit  isnt standing up?

Offline Arctic

  • Members
  • *
  • In Utero
Re:Cancelling playmove/switchmove
« Reply #5 on: 10 Feb 2003, 02:02:38 »
Yes, the unit just sits there. And when I issue the switchmove "" or playmove "" commands, the units just sits there... even when i am directly on top of them.

I can't get the unit to stand up and resume kicking my ass!

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #6 on: 10 Feb 2003, 02:06:39 »
Hmmm, dont get it.

You sure the script is getting out of the #Sit loop?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Cancelling playmove/switchmove
« Reply #7 on: 10 Feb 2003, 02:06:54 »
unitname switchmove "null"

will do ;) ;D

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

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #8 on: 10 Feb 2003, 02:07:32 »
"null" is the same as "", which is the same as many other commands that effectively remove the switchmove animation.  Unless of course they changed that for any very recent update to the game.  In which case,  I'll eat my wings.
« Last Edit: 10 Feb 2003, 02:10:30 by [icarus_uk] »

Offline Arctic

  • Members
  • *
  • In Utero
Re:Cancelling playmove/switchmove
« Reply #9 on: 10 Feb 2003, 02:13:12 »
Still doesnt....  >:(

Code: [Select]
_unit = _this select 0
_marker = _this select 1

#Sit
[_unit] exec "distance.sqs"
?(player knowsabout _unit): goto "posPlayer"

_unit playmove "EffectStandSitDown"
goto "Sit"

#posPlayer
_unit playmove "null"
_marker setpos [getpos player select 0,getpos player select 1,1]
#alert
?(!alive player): exit
?(!alive _unit): exit


_unit setcombatmode "RED"
_unit setbehaviour "Combat"

_unit commandmove getpos _marker

~4
?((_unit distance _marker) <= 1.5): goto "Patrol"
goto "alert"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Cancelling playmove/switchmove
« Reply #10 on: 10 Feb 2003, 02:32:01 »
lol right Icarus is prooly right ;D

but da prob is in da script  ::)

?(player knowsabout _unit): goto "posPlayer"

is not condition

but

?(player knowsabout _unit > 1): goto "posPlayer"

will work ;D

lol

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

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #11 on: 10 Feb 2003, 02:36:19 »
"prooly right"?  I know Im right :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Cancelling playmove/switchmove
« Reply #12 on: 10 Feb 2003, 02:37:38 »
but i dont  :P  ;D

LCD OUT

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

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Cancelling playmove/switchmove
« Reply #13 on: 10 Feb 2003, 02:38:37 »
Im pretty sure Ive had this exact same conversation with somone else on these forums. :D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Cancelling playmove/switchmove
« Reply #14 on: 10 Feb 2003, 02:41:36 »
it wasnt me ;D

if i ever try it ill tel u ;D till den it wil b prooly right ;)

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