loop delay

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

loop delay

Post by small_sumo »

This is the command i have in my script.

level.jvbot_loopdelay = 2.0

This what I saw in the log.

INFO[jv_mp_ai::setloopdelay]: Using new loop delay: 0.400 seconds (2 fps

Have I written the command wrongly?

Thanks JV.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Ops looks like a little bot bug :oops:

Basically there's two ways to fix this:
  • Place the level.jvbot_loopdelay = 2 line below the waitthread global/jv_bots/jv_mp_ai.scr::enable line.
  • Use setcvar jvbot_loopdelay 2 at any convenient time.
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Oh well thats ok, see now I can really see if it makes a difference to fps. Obviousley it never worked before I just didnt notice the error in the log.

Thanks.

:)
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

I'm kind of confused, jv:

Can we use:

setcvar jvbot_loopdelay 2

INSTEAD of :

level.jvbot_loopdelay = 2

????????

And the setcvar line should below waitthread etc?????
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The setcvar line can be placed anywhere you want. Setting level.jvbot_loopdelay after enabling the bots should also work but it may cause unexpected problems :?.
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Thanks. :D

And ,btw, the right way is:

setcvar "jvbot_loopdelay" "2"

Right?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yup, the second one is better, but as the mohaa scripting language isn't very 'strict' both will work.
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

So is this correct?

waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0 // enables bots
level.jvbot_loopdelay = 2.0
while !(level.roundstart)
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

small_sumo wrote:So is this correct?

waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0 // enables bots
level.jvbot_loopdelay = 2.0
while !(level.roundstart)
I think it will work, just gotta try it I guess ;). Preferrably add an additional wait though. Like:

Code: Select all

  waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0 // enables bots

  thread setloopdelay

  while !(level.roundstart)
    waitframe // I suppose this should be here ;)

  // (...)
end

setloopdelay:
  wait 1
  level.jvbot_loopdelay = 2.0
end
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Great thanks, I will add this to my revised map scripts.

Thanks man.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Post Reply