Page 1 of 1

Bots no defend no attack bomb

Posted: Thu Oct 19, 2006 6:05 pm
by truxako
I use to bd_bodger_botsmapper and the problem I have it when I want that go bots to by the bomb some times are going some to defend it other no but never they are going to attack it, this it is the error that always leaves although continuous way and with different coordinates, thank you very much advanced:

^~^~^ Path not found in 'Actor::MoveToPatrolCurrentNode' for (entnum 70, radnum -1, targetname 'ai: 6') from (2171.417969 7548.848145 -31.875000) to (2122.250000 -1949.010010 -11.875000)
Reason: unreachable path

Excuse my english.

Posted: Thu Oct 19, 2006 7:35 pm
by Green Beret
truxako wrote: I used bd_bodger_botsmapper and the problem i have is when i want the bots to go to the bomb, Some go to defend it, But never attack it.This is the error i get.
Im not sure, But i think its saying theres to much distance between this path node-->2171.417969 7548.848145 -31.875000
and this path node--->2122.250000 -1949.010010 -11.875000

Try moving them closer together, And make sure nothing is obstructing the path.

Posted: Thu Oct 19, 2006 8:20 pm
by truxako
thanks for your fast answer I have paid attention that the coordinates these are of the spawn of bot that attacks the bomb and the others of one of bombcamp.Perhaps the problem is that I do not use routes.
Is obligatory to use them? Single for nodes distant?
Even so, they defend few bombcamp. Other that are near no.

Posted: Fri Oct 20, 2006 3:45 am
by bdbodger
The bots mapper has a check box for automatically createing pathnodes as you run though the map . You must cover the map as best you can with pathnodes . In some tight places the spaceing of the nodes may make it difficult for the bots so on the node spawning part of the menu on the right hand side is an option to create a pathnode and use the movement keys to place it exactly where you need it . Run your map and bring up the leveldesign menu it maybe bound to a key but if not then open the console and type in showmenu leveldesign that should bring up the level design menu . Check the routes check box and you should see green lines that will show you the connections between pathnodes that the bots use to navigate . Any spots not connected the bots can not go so go through your map and find any spots not connected. If you need to rerun your map and add new pathnodes delete the .pth file first then rerun your map . I hope you understood the difference between a save script and the final script and have made both so you can go back and make changes .

Image

Posted: Wed Oct 25, 2006 6:23 pm
by truxako
I feel to answer that i don?t understand the difference.
I believe that I finish understanding it.
I use translators on-line who confuse to you instead of translating like sides with which I write.
if I do not understand bad "Write Save Script" it had served me to be able to retake the work with bd-bodger_botsmapper.
Is this? Thanks for everything in any case. the map will begin again. And it will use "Writes save Script". It will return to this post if I have some problem thanks.

Posted: Wed Oct 25, 2006 9:00 pm
by bdbodger
The save script spawns the temparary models you use while createing your map the final scirpt spawns the actuall pathnodes etc . I wish there was an esier way to save it so you can go back and add to it but there isn''t . You will have to make a save script every time before you quit just to be able to keep editing it .

Posted: Fri Oct 27, 2006 6:11 pm
by truxako
Hello, now the problem is this:
I have proven with a small piece of the map. I believe that pathnodes are well. I prove just spawned only 2 bots in the two teams. Bots does not go to attack the bomb and nor defends it. The console does not give any error. Except when I introduce some bots. With 3 or 4 bots in the teams. Then, the console type:

Code: Select all

if(local.campers < 0) (global/jv_bots/task_defendbomb.scr, 85)
		if(local.campers ^

^~^~^ Script Error: binary '<' applied to incompatible types 'NIL' and 'int'
local.campweight = 3.0 / (local.campers + 3) 

(global/jv_bots/task_defendbomb.scr, 89)
		local.campweight = 3.0 / (local.campers ^

^~^~^ Script Error: binary '+' applied to incompatible types 'NIL' and 'int'
local.campweight = 3.0 / (local.campers + 3) 

(global/jv_bots/task_defendbomb.scr, 89)
		local.campweight = 3.0 ^

^~^~^ Script Error: binary '/' applied to incompatible types 'float' and 'NIL'
local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight * local.bomb.weight * local.weight 

(global/jv_bots/task_defendbomb.scr, 100)
		local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'float'

local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight * local.bomb.weight * local.weight 

(global/jv_bots/task_defendbomb.scr, 100)
		local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'NIL'
local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight * local.bomb.weight * local.weight 

(global/jv_bots/task_defendbomb.scr, 100)
		local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight * local.bomb.weight ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'int'
local.score = 0.1 * (1024 / (local.distance + 1024)) + 

local.campweight * local.stateweight * local.bomb.weight * local.weight 

(global/jv_bots/task_defendbomb.scr, 100)
		local.score = 0.1 * (1024 / (local.distance + 1024)) ^

^~^~^ Script Error: binary '+' applied to incompatible types 'float' and 'NIL'
What is this?
This requesting to Me 1 campnode?
Excuse me english, again.
Thanks, very much for all.

Posted: Fri Oct 27, 2006 6:36 pm
by truxako
excuse me, but i can?t write this last in the code:
if(local.score > local.bestscore)

(global/jv_bots/task_defendbomb.scr, 64)
if(local.score ^


^~^~^ Script Error: binary '>' applied to incompatible types 'NIL' and 'int'

With this in the end, error is completed.
Thanks.

Posted: Fri Oct 27, 2006 8:36 pm
by jv_map
Oof this is bad :? ... uhm .. do you have bombcamp nodes in your map?

Posted: Fri Oct 27, 2006 9:23 pm
by truxako
Yes, I have some bombcamp, but any campnode or snipernode.

Posted: Fri Oct 27, 2006 10:47 pm
by jv_map
Hmm campnode and snipernode aren't needed...

Did you add a

$mybomb thread global/jv_obj_dm.scr::bomb_thinker

line to your map script?

Posted: Sat Oct 28, 2006 12:08 am
by truxako
Yes, perhaps in many lines. This is the script ("Map: Barcelona" obj "conquest: special CTF for mod 1936"):
[/code]// Barcelona
// ARCHITECTURE: YoChoy
// SCRIPTING: YoChoy
// Conquista: Herr_Kruger & Du
// KtG: Herr_Kruger, YoChoy, Du

main:
//exec global/botsmapper.SCR
waitexec maps/obj/primeraronda.bot
waitexec maps/truxako.scr::spawnpreset

setcvar "g_obj_alliedtext1" "Barcelona - 1936"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
// jugador.controlado

setcvar "g_scoreboardpic" "textures/mohmenu/barcelona"

level.gametype = int( getcvar( g_gametype ) )

if (level.gametype != 6)
{
$banderas remove
$postes remove
}
else thread global/1936_ctf.scr::iniciar

if( level.gametype == 4 )
{
setcvar "g_gametypestring" " Modo-Conquista"
setcvar "g_obj_alliedtext1" "Capturar la Bandera Nacional"
setcvar "g_obj_alliedtext2" "y acabar con el foco"
setcvar "g_obj_alliedtext3" "de resistencia"

setcvar "g_obj_axistext1" "Defender la Bandera Nacional"
setcvar "g_obj_axistext2" "y mantener las instalaciones "
setcvar "g_obj_axistext3" "para controlar Barcelona "

setcvar "g_scoreboardpic" "textures/mohmenu/cqt_barna"
}


if( level.gametype == 5 )
{

level.nacradios = makeArray
( 2848.26 -1063.75 514.13) ( 0 -7 0 )
( -3032.75 -2790.33 519.13) ( 0 -4 0 )
( 455.13 -3329.93 519.13 ) ( 0 1.65 0 )
endArray

level.repradios = makeArray
( -395.60 2620.30 581.13 ) ( 0 -4 0 )
( -1570.10 1490.95 515.13) ( 0 -97 0 )
( -2131.49 -1518.30 512.13) ( 0 -93 0 )
( 168.87 3158.15 128.18 ) ( 0 82 0 )
endArray

level.actoresaescena = ( -310 -2495 718 )

exec global/mag.scr
}

// call additional stuff for playing this map round based is needed
if(level.roundbased) thread roundbasedthread

///////////////////////
level waitTill prespawn
////////////////////////

exec global/DMprecache.scr
exec global/ambient.scr barcelona
level.script = maps/obj/primeraronda.scr

////////////////////
level waittill spawn
////////////////////

if (level.gametype == 4)
{
waitthread objetivos
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
//level.bomb_damage = 300
//level.bomb_explosion_radius = 1024
level.dmrespawning = 1
level.dmroundlimit = 10 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

//************************************************
// Se establecen los objetivos
//************************************************

$bomb thread global/jv_obj_dm.scr::bomb_thinker
thread allies_win_bomb $bomb
thread axis_win_timer $bomb

}


////////////tranvia
$tranvia.target=$t0
$tranvia2.target=$t28
$tranvia thread tprepare
$tranvia2 thread tprepare



//------------------------------------------------------------------------


//************************************************
// Ganan Republicanos
//************************************************

allies_win_bomb local.bomb:

while(local.bomb.exploded != 1)
waitframe
thread camara_barna

wait 25
iprintlnbold "Los Republicanos han tomado Barcelona!"
waitframe

teamwin allies
end

//************************************************
// Ganan Nacionales
//************************************************

axis_win_timer:
level waittill axiswin
end

//---------------------------------------------------------------------
$bomb thread global/jv_obj_dm.scr::bomb_thinker
waitthread global/jv_bots/jv_mp_ai.scr::enable
thread allies_win_bomb
$bomb thread axis_win_timer
thread message
end

//************************************************
// Preparamos la Bandera-Objetivo
//************************************************

objetivos:

spawn trigger_use "targetname" "trig"
$trig.origin = ( -2142.89 2042.81 480.13 )
$trig setsize ( -80 -80 -80 ) ( 80 80 80 )

spawn models/static/barbwire_post.tik "targetname" "poste"
$poste.origin = ( -2142.89 2042.81 480.13 )
$poste.angles = ( 0 0 13 )

spawn models/static/nacional.tik "targetname" "banderana"
$banderana.origin = ( -2187.89 2042.81 540.13 ) + ( 0 13 0)
$banderana.angles = ( 0 75 0 )

spawn script_model "model" animate/pulse_explosive.tik "targetname" "bomb"
$bomb.origin = ( -2142.89 2042.81 560.13 ) + ( 0 20 10)
$bomb.angles = ( 15 49 0 )
$bomb.trigger_name = trig
$bomb.target = $banderana
$bomb hide
$bomb notsolid

$bomb thread global/jv_obj_dm.scr::bomb_thinker

waitthread global/jv_bots/jv_mp_ai.scr::enable

thread allied_win_bomb
thread axis_win_timer

addobjective 1 1 "" $bomb.origin
setcurrentobjective 1

end


tprepare:
self.faro = spawn script_model
self.faro model "miscobj/searchlight.tik"
self.faro.angle = 180
self.faro.origin = self.origin + ( 45 0 20 )
self.faro notsolid
self.faro bind self
self.consola = spawn script_model
self.consola model "miscobj/trainswitch.tik"
self.consola.origin = self.origin + ( 10 -10 0 )
self.consola notsolid
self.consola bind self
self.palanca = spawn trigger_use
self.palanca setsize ( -14 -14 4 ) ( 14 14 84 )
self.palanca.origin = self.origin
self.palanca bind self
self.frontal = spawn trigger_hurt //spawnflags "144"
self.frontal setsize ( -4 -44 -14 ) ( 4 44 64 )
self.frontal.origin = self.origin + ( 75 0 0 )
self.frontal damage 50
self.frontal nottriggerable
self.frontal bind self
self.trasero = spawn trigger_hurt //spawnflags "144"
self.trasero setsize ( -4 -44 -14 ) ( 4 44 64 )
self.trasero.origin = self.origin + ( -425 0 0 )
self.trasero damage 50
self.trasero nottriggerable
self.trasero bind self
self.origin=self.target.origin
// self.angle = (self.target.angle - 90)
self rotateyupto self.target.angle
self moveto self.target
self waitmove
tinicio:
self.palanca waittill trigger
self.conductor = parm.other
self.palanca remove
self.conductor glue self
self.conductor takedamage
self.conductor.origin = self.origin + ( 10 10 32 )
self.conductor iprint "Pulsa Disparo para avanzar"
self.conductor iprint "Pulsa Secundario para retroceder"
self.conductor iprint "Pulsa Usar para moverte"
self.conductor safeholster 1
self time 1.5
wait 0.5
while ((self.conductor.useheld == 0) && (self.conductor.dmteam == self.conductor.equipo))
{
if (self.conductor.primaryfireheld == 1)
{
self playsound tranvia
self loopsound torreta
self waitthread adelante
self stoploopsound
}
else if (self.conductor.secondaryfireheld == 1)
{
self playsound tranvia
self loopsound torreta
self waitthread atras
self stoploopsound
}
wait 0.2
}
if (self.conductor.dmteam != self.conductor.equipo) self.conductor spectator
self.conductor unglue
self.conductor forcelegsstate "STAND"
self.conductor = ""
self.palanca = spawn trigger_use
self.palanca setsize ( -14 -14 4 ) ( 14 14 84 )
self.palanca.origin = self.origin
self.palanca bind self
goto tinicio
end
adelante:
waitframe
self.frontal triggerable
if (self.target.target)
{
if (self.target.target.angle == 350) self rotateydownto 350
if (self.target.target.angle == 333) self rotateydownto 333
if (self.target.target.angle == 320) self rotateydownto 320
if (self.target.target.angle == 345) self rotateydownto 345
if (self.target.target.angle == 359) self rotateydownto 359
if (self.target.target.angle == 17) self rotateyupto 17
if (self.target.target.angle == 38) self rotateyupto 38
if (self.target.target.angle == 4) self rotateydownto 4
if (self.target.target.angle == 0) self rotateydownto 0
if (self.target.target.angle == 158) self rotateydownto 158
if (self.target.target.angle == 145) self rotateydownto 145
if (self.target.target.angle == 168) self rotateyupto 168
if (self.target.target.angle == 190) self rotateyupto 190
if (self.target.target.angle == 195) self rotateyupto 195
if (self.target.target.angle == 210) self rotateyupto 210
if (self.target.target.angle == 191) self rotateydownto 191
if (self.target.target.angle == 180) self rotateydownto 180

self moveto self.target.target
self waitmove
self.target = self.target.target
}
else self stoploopsound
if (self.conductor.primaryfireheld == 1) goto adelante
self.frontal nottriggerable
end

atras:
waitframe
self.trasero triggerable
if (self.target.previo)
{
if (self.target.previo.angle == 350) self rotateydownto 350
if (self.target.previo.angle == 333) self rotateydownto 333
if (self.target.previo.angle == 320) self rotateydownto 320
if (self.target.previo.angle == 345) self rotateydownto 345
if (self.target.previo.angle == 359) self rotateydownto 359
if (self.target.previo.angle == 17) self rotateydownto 17
if (self.target.previo.angle == 38) self rotateyupto 38
if (self.target.previo.angle == 4) self rotateyupto 4
if (self.target.previo.angle == 0) self rotateyupto 0
if (self.target.previo.angle == 158) self rotateyupto 158
if (self.target.previo.angle == 145) self rotateydownto 145
if (self.target.previo.angle == 168) self rotateydownto 168
if (self.target.previo.angle == 190) self rotateydownto 190
if (self.target.previo.angle == 195) self rotateydownto 195
if (self.target.previo.angle == 210) self rotateyupto 210
if (self.target.previo.angle == 191) self rotateyupto 191
if (self.target.previo.angle == 180) self rotateyupto 180
self moveto self.target.previo
self waitmove
self.target = self.target.previo
}
else self stoploopsound
if (self.conductor.secondaryfireheld == 1) goto atras
self.trasero nottriggerable
end


//************************************************
// Preparamos y ejecutamos la c?mara final ;)
//************************************************

camara_barna:

fadein 5 0 0 0 3

spawn func_camera "targetname" "watch_camera"
$watch_camera.origin = ( -95.03 1047.43 650)
$watch_camera.angles = ( -3.87 -84.59 0)

spawn script_object "targetname" "camera_path" "classname" "info_splinepath"
$camera_path.origin = ( -95.03 1047.43 650)
$camera_path target a01
$camera_path.angle = -84

spawn script_object "targetname" "a01" "classname" "info_splinepath"
$a01.origin = ( -95.03 1047.43 650)
$a01 target a0
$a01.angle = -109

spawn script_object "targetname" "a0" "classname" "info_splinepath"
$a0.origin = ( -1103.38 620.64 550)
$a0 target a1
$a0.angle = -109

spawn script_object "targetname" "a1" "classname" "info_splinepath"
$a1.origin = ( -1690.13 -711.76 550 )
$a1 target a2
$a1.angle = -99.57

spawn script_object "targetname" "a2" "classname" "info_splinepath"
$a2.origin = ( -1812.72 -1621.08 528.92)
$a2 target a3
$a2.angle = -83

spawn script_object "targetname" "a3" "classname" "info_splinepath"
$a3.origin = ( -1608.29 -2707.10 550)
$a3 target a4
$a3.angle = -51.31

spawn script_object "targetname" "a4" "classname" "info_splinepath"
$a4.origin = ( -1149.94 -4032.77 550)
$a4 target a5
$a4.angle = 35

spawn script_object "targetname" "a5" "classname" "info_splinepath"
$a5.origin = ( 474.17 -2910.89 580)
$a5 target a6
$a5.angle = 28

spawn script_object "targetname" "a6" "classname" "info_splinepath"
$a6.origin = ( 1047.55 -2297.18 580 )
$a6 target a7
$a6.angle = 66

spawn script_object "targetname" "a7" "classname" "info_splinepath"
$a7.origin = ( 1651.00 -604.09 594 )
$a7 target a8
$a7.angle = 73

spawn script_object "targetname" "a8" "classname" "info_splinepath"
$a8.origin = ( 1967.15 595.71 594 )
$a8 target a9
$a8.angle = 86

spawn script_object "targetname" "a9" "classname" "info_splinepath"
$a9.origin = ( 2002.41 1394.38 574.82 )
$a9 target a10
$a9.angle = 99.53

spawn script_object "targetname" "a10" "classname" "info_splinepath"
$a10.origin = ( 1700.76 2134.06 601.55 )
$a10 target a11
$a10.angle = 96.06

spawn script_object "targetname" "a11" "classname" "info_splinepath"
$a11.origin = ( 1700.76 2134.06 610 )
$a11 target a12
$a11.angle = 166

spawn script_object "targetname" "a12" "classname" "info_splinepath"
$a12.origin = ( 925.68 2278.74 660 )
$a12 target a13
$a12.angle = -142


spawn script_object "targetname" "a13" "classname" "info_splinepath"
$a13.origin = ( -1238.30 1638.86 970.56)
$a13 target a14
$a13.angle = -60.71

spawn script_object "targetname" "a14" "classname" "info_splinepath"
$a14.origin = ( -2059.68 796.45 1200.58)
$a14 target a15
$a14.angle = -36.97

spawn script_object "targetname" "a15" "classname" "info_splinepath"
$a15.origin = ( -2311.70 -585.84 1400.96)
$a15 target a16
$a15.angle = 4.56

spawn script_object "targetname" "a16" "classname" "info_splinepath"
$a16.origin = ( -1259.18 -2391.42 1700)
$a16 target a17
$a16.angle = 59.60

spawn script_object "targetname" "a17" "classname" "info_splinepath"
$a17.origin = ( 1957.67 -1791.64 1500)
$a17 target a18
$a17.angle = 136

spawn script_object "targetname" "a18" "classname" "info_splinepath"
$a18.origin = ( 2629.89 -538.30 1750)
$a18 target a19
$a18.angle = 171

spawn script_object "targetname" "a19" "classname" "info_splinepath"
$a19.origin = ( 3162.80 48.14 1650)
$a19 target a20
$a19.angle = -176.92

spawn script_object "targetname" "a20" "classname" "info_splinepath"
$a20.origin = ( 3340.44 -181.25 1532.10)
$a20.angles = ( -3.67 178.27 0)

wait .1

drawhud 0 // Limpiamos todo

//congelamos los jug y que no se hagan da?o
$player nodamage
$player hide
freezeplayer

forcemusic aux3 aux3

$piquer stoploopsound piquer

level.dmroundlimit = (level.dmroundlimit + 1)

//lista la camara
$watch_camera fov 80 2
$watch_camera speed .8
$watch_camera follow $camera_path //que empiece
wait .1

//peli..
letterbox 0.5

cuecamera $watch_camera
//end

waitexec maps/truxako.scr::addbot
waitexec maps/truxako.scr::message
$bomb thread global/jv_obj_dm.scr::bomb_thinker
waitthread global/jv_bots/jv_mp_ai.scr::enable
thread allies_win_bomb
$bomb thread axis_win_timer
thread message
end

level waittill roundstart


roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn

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


end

Posted: Sat Oct 28, 2006 7:01 am
by jv_map
Ah right, thanks for posting the script, that greatly helps in finding and solving the problem :)

Check your script logic, the line

$bomb thread global/jv_obj_dm.scr::bomb_thinker

is called more than once (not good)... in fact I'm not sure what errors that could cause but it's better to be sure and just call it once :wink:

The errors you posted earlier are probably because your bomb does not have a 'campset' key. I made the bots too long ago to tell if the key is needed when you have only 1 bomb, but try adding it anyway.

$bomb.campset = 1

and add .set = 1 to all bombcamp nodes, too.

See this page on how to set up bombs:
http://freebrief.planetmedalofhonor.gam ... apt-5.html