Home   Help Search Login Register  

Author Topic: Bit of trouble  (Read 679 times)

0 Members and 1 Guest are viewing this topic.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Bit of trouble
« on: 14 Oct 2004, 00:09:24 »
I'm having a bit o trouble, m8s.

In theory, the UnitReady command is supposed to wait until the unit is checks for is stopped moving and ready. But when I used this in a cutscene to check when the unit is done moveing to a marker it automatically triggers, event if the unit is in motion.

Do I need to change this:
Code: [Select]
@UnitReady loon_cam_one

This should make the script pause until the unit loon_cam_one is 'ready'. Any help, m8s?

Cheers,
Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Blanco

  • Former Staff
  • ****
Re:Bit of trouble
« Reply #1 on: 15 Oct 2004, 16:24:35 »
Maybe the walking distance is too close...
Is it not safer to check the distance between loon and marker?
Or is that not possible with markers?  ::)
It works with gamelogics for sure.



Search or search or search before you ask.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Bit of trouble
« Reply #2 on: 15 Oct 2004, 17:29:11 »
The unitready command really checks to see when a unit has completed a command, like a move command, or an attack command. In your case, the unit reaches his waypoint, then for an instant he has completed his command and your script continues, and then he goes right into his next move command. So, depending on what you are trying to do, you could do something like putting a timer in the waypoint.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Bit of trouble
« Reply #3 on: 16 Oct 2004, 03:19:05 »
well, actually, i check to see if hes completed a doMove command. Maybe thats the bloody problem. I'll try using wps, but if i can't fet it to work, i'll just use the distance code. Personally, distance is unprofessional, so i've been trying to find a way around it.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Bit of trouble
« Reply #4 on: 16 Oct 2004, 03:40:58 »
Try sticking a pause after the domove command, eg.

unit domove position
~1
@ unitready unit

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Bit of trouble
« Reply #5 on: 16 Oct 2004, 03:47:06 »
okay, maybe that will work.

let you know asap, m8s

cheers,
Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Bit of trouble
« Reply #6 on: 16 Oct 2004, 16:19:53 »
Try sticking a pause after the domove command, eg.

unit domove position
~1
@ unitready unit
Yup, pause is the way to go...
But it should be longer than one sec though... (I know Sui, it's just an example ;D )

I had this similar problem a while back with one script of mine...
It seems the unitReady checks whether the unit is stopped after the doMove command because if you order the AI to move from opposite direction than it's facing, it takes several seconds before the unit is actually obeying the doMove (the unit must 'wake up',make a smaal twitch, turn, make a small twitch, and then start to run...) so the engine thinks the unit has already obeyed it's order as it was given the doMove order and it's not moving anymore...
So, the doMove command is not 'active' until the unit is actually moving and so there needs to be a pause between the doMove and the unitReady check...

Someone will probably say I'm wrong, but this is my experience with it... :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Bit of trouble
« Reply #7 on: 16 Oct 2004, 21:19:56 »
yes, it works with the pause, m8s ;D
it takes about a five second one, for the bloody sloooww loons, but with most of the units, it take's only about a second or two

tanks for the help m8,
Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08