Page 1 of 2

[Solved] Route system error

Posted: Sun May 18, 2003 9:40 pm
by Bjarne BZR
I get this, and the routes are not working:
JvBot 1.1 wrote:ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route axis_bomb_long
ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route axis_bomb_short
ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route allied_bomb_short
...but...
Multiplayer Bots Manual wrote:Add key ?#id? and value ?1? for the node nearest to the destination of the route.
Is this incorrect? Should the enumeration start at 0?

Posted: Mon May 19, 2003 9:49 am
by jv_map
No node 0 is the destination node and should automatically be set by the bot script. I think you have made certain routes but there isn't an entity with a $route key equal to that route, or a routelist is missing. It may also be a missing 'route tracer', i.e. the node isn't checked for a $route key. The bot script by default checks all entities with certain targetnames, and if you add the $route key to an entity with a different targetname the script can find this destination. So did you assign a $route key to certain entities? And if yes, what's their targetname?

One more note, the bot scripts include a route debug tool, which can be enabled through the bot parameters:
waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 1 0

The '1' (third parameter) enables the route debuging, which results in console output while setting up the routes.

Posted: Mon May 19, 2003 10:25 am
by Bjarne BZR
There is no entity with the $route key... but a script_model ( a bomb ) with the $routelist key ( value: routes_to_bomb ) and in the script I've got

Code: Select all

level.routelist[routes_to_bomb] = "axis_bomb_short"::"allied_bomb_short"::"axis_bomb_long"
Here is the trace with route debugging enabled:

Code: Select all

INFO[jv_mp_ai::enable]: Route debug enabled.
INFO[jv_mp_ai::addroute]: Added route tracer for targetname sniper.
INFO[jv_mp_ai::routesetup]: Tracing routes to sniper
Route: axis_bomb_long
-------------------------
ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route axis_bomb_long
	Node: [0] NIL
	Node: [1] route
	Node: [2] route
	Node: [3] route
	Node: [4] route
	Node: [5] route
	Node: [6] route
	Node: [7] route
	Node: [8] route
LastID: 8
-------------------------
Route: axis_bomb_short
-------------------------
ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route axis_bomb_short
	Node: [0] NIL
	Node: [1] route
	Node: [2] route
	Node: [3] route
	Node: [4] route
	Node: [5] route
	Node: [6] route
	Node: [7] route
LastID: 7
-------------------------
Route: allied_bomb_short
-------------------------
ERROR[jv_mp_ai::routesetup]: Node 0 is missing for route allied_bomb_short
	Node: [0] NIL
	Node: [1] route
	Node: [2] route
	Node: [3] route
	Node: [4] route
	Node: [5] route
	Node: [6] route
LastID: 6
-------------------------
It IS the bomb that should have the $routelist key, right? Not the last pathnode?

Posted: Mon May 19, 2003 10:39 am
by Bjarne BZR
Bjarne BZR wrote:It IS the bomb that should have the $routelist key, right? Not the last pathnode?
After reading the manual with the exactness of a laser beam... I've noticed that the examples talk of setting up a bombnode entity as the destination of a route... If this is correct, the node 0 is indeed missing because it wont look at bombs... only pathnodes... right?

I'm going to try to set it up this way, and do a re-compile... back in 6 or so hours... if I'm way out of line here: Please ttell me so at once so I can break the unnessesary compile...

Posted: Mon May 19, 2003 2:48 pm
by jv_map
That's right, you need to add the $routelist key to the bombnode entity, since it's where the bot walks to ;).

Posted: Mon May 19, 2003 2:57 pm
by Bjarne BZR
Hmm... yeah.... I really must take some time one of these days to R T F M !!!!! :wink:

Posted: Mon May 19, 2003 3:04 pm
by jv_map
Well the manual isn't always all that clear :oops:

Posted: Mon May 19, 2003 3:24 pm
by Bjarne BZR
Maby not clear, but the info always seem to be there. I prefer good info to good structure ( But OK, both is better :wink: ).

Posted: Mon Jun 16, 2003 9:58 am
by Bjarne BZR
jv_map wrote:It may also be a missing 'route tracer', i.e. the node isn't checked for a $route key. The bot script by default checks all entities with certain targetnames, and if you add the $route key to an entity with a different targetname the script can find this destination. So did you assign a $route key to certain entities? And if yes, what's their targetname?
I'm now having the same problem setting up routes to the "targetname triggernode" pathnode that is used by the trigger task you created. My guess is that "triggernode" is not one of the targetnames that the bot-script searches for... and if so: can I tell it to search for it?

Posted: Mon Jun 16, 2003 11:24 am
by jv_map
Yes you can (actually I should've added it to the setup section of the trigger task :oops: ).

Here's the line you can either put in your map's script or add to task_trigger.scr in the setup thread:

waitthread level.jvbot_main_script::addroute triggernode
(if placed in task_trigger.scr)

or
waitthread global/jv_bots/jv_mp_ai.scr::addroute triggernode
(if placed above the bots enable line in your map script)

Posted: Mon Jun 16, 2003 1:40 pm
by Bjarne BZR
OK... the good thing:

I'm getting this in the console:
console wrote:INFO[jv_mp_ai::addroute]: Added route tracer for targetname triggernode.
...but there is someting wrong with the routelists now, they look like this and dont work:

Code: Select all

-------------------------
Route: bomb_to_desk
-------------------------
	Node: [0] Type 'array'
	Node: [1] route
	Node: [2] route
	Node: [3] route
	Node: [4] route
	Node: [5] route
	Node: [6] route
	Node: [7] route
	Node: [8] route
	Node: [9] route
	Node: [10] route
LastID: 10
The workin ones look like this:

Code: Select all

Route: allied_bomb_short
-------------------------
	Node: [0] list:
		[1] bombnode
		[2] bombcamp
		[3] bombcamp
		[4] bombcamp
		[5] bombcamp
		[6] bombcamp
		[7] bombcamp
		[8] bombcamp
	Node: [1] route
	Node: [2] route
	Node: [3] route
	Node: [4] route
	Node: [5] route
	Node: [6] route
LastID: 6
My guess here is that the fault is still in Node: [0]... because the

Code: Select all

INFO[jv_mp_ai::addtask]: Added task trigger (priority: 100).
is printed in the log AFTER the routes has been set up... and alll other tasks are added before the route setup...

???

My script looks like this:

Code: Select all

level waittill spawn
	level.routelist[routes_to_desk_doc] = "wall_to_desk"::"bomb_to_desk"
	level.routelist[routes_to_wall_doc] = "desk_to_wall"::"bomb_to_wall"
	level.routelist[routes_to_bomb] = "axis_bomb_short"::"allied_bomb_short"::"axis_bomb_long"
	$distiller_bomb thread global/jv_obj_dm.scr::bomb_thinker
	waitthread global/jv_bots/jv_mp_ai.scr::addroute triggernode 
	waitthread global/jv_bots/jv_mp_ai.scr::enable 1 1 1 1
	waitthread level.jvbot_main_script::addtask trigger 100
(The bot-part anyway)

Posted: Mon Jun 16, 2003 2:06 pm
by jv_map
Hmm there doesn't seem anything wrong with this output. The 'type array' is a bit weird but it happens often, I'm still not sure why :?

The 'added task trigger' message appears later since it's added from your map script after the bots are enabled, but this shouldn't be a problem (tasks are independent from routes).

Posted: Mon Jun 16, 2003 2:14 pm
by Bjarne BZR
So the route should work with Node: [0] Type 'array' ?

Posted: Mon Jun 16, 2003 2:39 pm
by jv_map
Yes :)

Posted: Tue Jun 17, 2003 9:34 pm
by Bjarne BZR
Guess what... they work like a... a... a thing that works. :D

It just needed a proper compile ( the 24h kind, not the wonderful ?minute -onlyents compile ).

-> :D <-