Bind/glue a jvbot into a truck?

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

Moderator: Moderators

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

Post by jv_map »

level.botlastid should be fine 8-)

One issue I can think of is that the level.actualbots array may change between frames (i.e. when a bot dies or a new one is spawned), so in fact it's better to use a local array here instead of the level array... for example put this at the top of your thread:

Code: Select all

local.actualbots = level.actualbots
local.botlastid = level.botlastid
and use local.actualbots and local.botlastid instead of the level. versions for the rest of your thread... this way you'll be sure you're not missing any bots or ordering some bots to enter the truck twice.

:)
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Didn't understand...

1) Put that in the top of the thread means before "$botgo_trigger waittill trigger" or after?

2) Should I replace "local.bot" by "local.actualbots"? Or by "local.botlastid"? In the whole thread?

3) Should I replace the line that says:

local.bot = level.actualbots[local.i]

by local.actualbots = level.actualbots[local.i] ?

4) Should the whole thing looks like:
bot_go1:

$botgo_trigger waittill trigger
local.actualbots = level.actualbots
local.botlastid = level.botlastid

for(local.i = 1; local.i <= level.botlastid; local.i++)
{
local.actualbots = level.actualbots[local.i]
local.node = $("faketruck_playerspot_" + level.truckspot)

if(isalive local.bot && local.bot.dmteam == axis)
{
local.actualbots runto $crouch_position
local.actualbots waittill movedone
local.actualbots holster
local.actualbots exec global/moveto.scr anim/crouch_run.scr local.node
level.truckspot--
}
}
end
:?:
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

almost

Post by jv_map »

Code: Select all

bot_go1:

$botgo_trigger waittill trigger
local.actualbots = level.actualbots
local.botlastid = level.botlastid

for(local.i = 1; local.i <= local.botlastid; local.i++)
{
local.bot = local.actualbots[local.i]
local.node = $("faketruck_playerspot_" + level.truckspot)

if(isalive local.bot && local.bot.dmteam == axis)
{
local.actualbots runto $crouch_position
local.actualbots waittill movedone
local.actualbots holster
local.actualbots exec global/moveto.scr anim/crouch_run.scr local.node
level.truckspot--
}
}
end
:idea:
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Thanks, jv :)

Now, why the level.truckspot doesn't drop by 1? It drops by 3 points (w/ 1 bot) and drops by 8 w/ 2 bots...

Do you think it's a good idea to have 2 triggers, one in the spawn area and other in the truck entrance? to avoid confusion..
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Just a silly question as I couldn't find it in your previous posts :oops: - how is this bot_go1 thread called?

And, it is always a good idea to avoid confusion :)
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Is called by a trigger multiple envolving the axisspawn script origin..as they spawn, the trigger activates...I'm getting crazy w/ this... :roll:

I have another trigger near the truck entrance...I was using but seems easy to put everything in the same thread

want the map/scr file?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well just incase you're using setthread, be aware that it is called every server frame a bot / player is in the trigger, hence you could have 3 bot_go1 threads running at once, each decreasing the level.truckspot value by 1...
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Yeah, I realized that the hard way :cry: . But how to use w/o setthread?

But Wacko saw the light :idea: :D !

Adding a "$botgo_trigger nottriggerable" right after the trigger gets activate, is doing the job! And, of course, a "$botgo_trigger triggerable" in the end.

I'm feeling I'm getting closer 8-) BUT...

Now level.truckspot drops by 1 but, this is what happens:

I was thinking in add another variable (level.botbusy) to make the 2nd bot wait til the 1st bot is inside the truck binded ready to go...The thing is the 2nd bot is ignoring this variable :? Even when the 1st bot is already going, he spawns and go too...check the new thread:
bot_go1:

$botgo_trigger waittill trigger
$botgo_trigger nottriggerable // YEAH
local.actualbots = level.actualbots
local.botlastid = level.botlastid

for(local.i = 1; local.i <= local.botlastid; local.i++)
{
local.bot = local.actualbots[local.i]
local.node = $("faketruck_playerspot_" + level.truckspot)

if(isalive local.bot && local.bot.dmteam == axis && level.botbusy == 0)
{

level.botbusy = 1 // IT'S WORKING, I CAN SEE...
local.actualbots runto $crouch_position
local.actualbots waittill movedone
local.actualbots holster

local.actualbots exec global/moveto.scr anim/crouch_run.scr local.node
local.actualbots waittill movedone
local.actualbots exec anim/crouch.scr
local.actualbots turnto $bots_aim // USELESS, HE DON'T TURN...THATS OK
if(local.bot.dmteam == axis)
{
local.actualbots glue $("faketruck_playerspot_" + level.truckspot) // GLUE
}
level.truckspot-- // IT'S WORKING
$botgo_trigger triggerable // COOL...HERE'S OK?
level.botbusy = 0 // WORKING TOO...
}
}
end
Notice the level.botbusy at the top, together w/ the local.bot.dmteam. As the first bot spawn, this variable goes to 1, but the 2nd bot ignores it.

And the most funny. I was using bind, but this way the bot seems to "float" very slowly (I only notice in the 2nd try). I try shooting at him and his death body floats like I said before...gr...So I changed to glue and worked fine. The prob is, when the truck starts the ride, the allied bot suddenly appears in the german's spot and I ride w/ the 2 guys...Is that clear?

So I putted the alliesspawn where I can see it, inside a wall w/ caulk so he cannot see us...He crouches when the axis bot crouches too...

Really don't know if i'm getting only the bot I want...

Another thing: Can I delay the bots spawn time?

Help me :cry: !
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Not much time so a quick one but remember to put level.botbusy = 0 at the top of your script (otherwise it will be NIL at first check).
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

jv_map wrote:Not much time...
buuaa'''' :cry: :cry: :cry:

Yeah (sic), I putted level.botbusy = 0 at the top (sic)...
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well I didn't see it in the script you posted, but I'll assume it's implicitly there :wink:
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Don't worry, the level.botbusy starts in 0, I'm pretty sure.

Well, hope u have some time for me later...I'll keep trying/waiting...
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Alright in that case I think it's best to spam your script with debug println commands, like at every key spot in your script add something like this:

println "bot_go1 thread start"

or

println "bot_go1 thread - runto bot is " local.bot " i " local.i " botbusy " level.botbusy " truckspot " level.truckspot

I'm pretty confident this will give you very insightful results with a minimum amount of effort :) Just remember to make a log with logfile 2 8-)
Image
Post Reply