Page 1 of 1

Noob Question: Adding BOT script

Posted: Sun Nov 23, 2003 4:54 pm
by BiG_HeaD
How do i add bots script to this:





// Custom objective test map
// ARCHITECTURE: BiG_HeaD
// SCRIPTING: BiG_HeaD

main:


setcvar "g_obj_alliedtext1" "Destroy the control"
setcvar "g_obj_alliedtext2" "panel"
setcvar "g_obj_alliedtext3" "" setcvar "g_obj_axistext1" "Defend the control"
setcvar "g_obj_axistext2" "panel"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"


level waittill prespawn


exec global/DMprecache.scr
level.script = maps/obj/cust_obj_test.scr
exec global/ambient.scr cust_obj_test
thread global/exploder.scr::main // Initialize the exploder subsystem


level waittill spawn


level.defusing_team = "axis" // Axis like the bombs unplanted
level.planting_team = "allies" // Allies will try to plant the bombs
level.targets_to_destroy = 1 // Number of targets in this map
level.bomb_damage = 200 // Default damage of the bomb
level.bomb_explosion_radius = 2048 // Default radius of bomb blast


// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw


// level waittill roundstart // Comment out this line using '//' before it to be able to set the bomb when alone on the map ( just for testing )


$panel_bomb thread global/obj_dm.scr::bomb_thinker // "panel_bomb" is the targetname set on the bomb in MOHRadiant
thread allies_win_bomb // Start the win check thread for allies
$panel_bomb thread axis_win_timer // Start the win check thread for axis
end // end of main

// Allied victory test


allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy) // While undestroyed objectives left
waitframe // chill out
teamwin allies // No objectives left allies win
end // end allied victory test

// Axis victory test


axis_win_timer:
level waittill axiswin // At the end Axis win
end // end axis victory test

Posted: Mon Nov 24, 2003 6:25 pm
by jv_map
thread global/jv_bots/jv_mp_ai.scr::enable

Below the 'xxx thread global/jv_obj_dm.scr::bomb_thinker' line

Posted: Mon Nov 24, 2003 8:09 pm
by BiG_HeaD
not sure what that means, Jv :(

Posted: Mon Nov 24, 2003 9:00 pm
by jv_map
Sorry I will rephrase :)

Add

thread global/jv_bots/jv_mp_ai.scr::enable

Below the 'xxx thread global/jv_obj_dm.scr::bomb_thinker' line

Posted: Tue Nov 25, 2003 2:27 am
by BiG_HeaD
jv_map wrote:
Add

thread global/jv_bots/jv_mp_ai.scr::enable

Below the 'xxx thread global/jv_obj_dm.scr::bomb_thinker' line

Gosh, Am i blind? Cuase I cant see the
'xxx thread global/jv_obj_dm.scr::bomb_thinker'
line :(

Posted: Tue Nov 25, 2003 7:30 am
by jv_map
oh :)

$panel_bomb thread global/obj_dm.scr::bomb_thinker

should be

$panel_bomb thread global/jv_obj_dm.scr::bomb_thinker

Posted: Tue Nov 25, 2003 4:58 pm
by BiG_HeaD
New Script:

main:

level waittill prespawn

$world farplane 3000
$world farplane_color (.333 .333 .329)

setcvar "g_obj_alliedtext1" "Go2Town"
setcvar "g_obj_alliedtext2" "KillSumAxis"
setcvar "g_obj_alliedtext3" "FindtheBomb"
setcvar "g_obj_axistext1" "- Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" "MadeBy BiG_HeaD"
setcvar "g_scoreboardpic" "objdm1.tga"

exec global/DMprecache.scr
level.script = maps/obj/objtest.scr

exec global/ambient.scr m4l1

thread global/exploder.scr::main
exec global/door_locked.scr::lock

level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 2048

level.dmrespawning = 0
level.dmroundlimit = 5
level.clockside = draw

thread allies_win_bomb
$panel_bomb thread axis_win_timer
thread bombscript


$panel_bomb thread global/jv_obj_dm.scr::bomb_thinker
thread global/jv_bots/jv_mp_ai.scr::enable

end


bombscript:

$flak88_explosive1 thread global/jv_obj_dm.scr::bomb_thinker

level.alliesbots = 3
level.axisbots = 3


waitthread global/jv_bots/jv_mp_ai.scr::enable


$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb

$bomb thread global/jv_obj_dm.scr::bomb_thinker

end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies

end



Theres Gotta be some errors in there cuase The Bomb isnt working, and the map, upon restart, boots me.

Posted: Tue Nov 25, 2003 5:16 pm
by jv_map
You need only one

waitthread global/jv_bots/jv_mp_ai.scr::enable

line, and all bomb_thinker lines need to be executed before running this enable line.

Posted: Wed Nov 26, 2003 9:23 pm
by BiG_HeaD
I need more help. What do i Change?

Posted: Sun Nov 30, 2003 1:29 am
by BiG_HeaD
jv-I dont wanna sound like a noob, but i dont get it!

Posted: Sun Nov 30, 2003 7:53 am
by jv_map
You should not have more than one

waitthread global/jv_bots/jv_mp_ai.scr::enable

line, right now you have two. Also, if you have only one bomb you should have no more than one bomb_thinker line.

Posted: Sun Nov 30, 2003 8:08 pm
by BiG_HeaD
Bots go to the bomb, and just stand their.

main:

level waittill prespawn

$world farplane 3000
$world farplane_color (.333 .333 .329)

setcvar "g_obj_alliedtext1" "Go2Town"
setcvar "g_obj_alliedtext2" "KillSumAxis"
setcvar "g_obj_alliedtext3" "FindtheBomb"
setcvar "g_obj_axistext1" "- Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" "MadeBy BiG_HeaD"
setcvar "g_scoreboardpic" "objdm1.tga"

exec global/DMprecache.scr
level.script = maps/obj/objtest.scr

exec global/ambient.scr m4l1

thread global/exploder.scr::main
exec global/door_locked.scr::lock

level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 2048

level.dmrespawning = 0
level.dmroundlimit = 5
level.clockside = draw

thread allies_win_bomb
$panel_bomb thread axis_win_timer
thread bombscript


$panel_bomb thread global/jv_obj_dm.scr::bomb_thinker
thread global/jv_bots/jv_mp_ai.scr::enable

end


bombscript:

$flak88_explosive1 thread global/jv_obj_dm.scr::bomb_thinker

level.alliesbots = 3
level.axisbots = 3

$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb

end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies

end