Master Cabalist
Member
Hi
I would like a sentry bat character to travel from one spot to another on the game map. So it appears that the sentry bat appears at the last level finished and they march to the next level on the game map.
This is the code:
The controller (TravelMasterbk) directs the march:
Where SentryBatWalkMap is an instance of the marching character. Its step event is:
When I try to run this I get the following error:
Before you jump at it, Path53 exists as a path in the map room on the map.
I would like a sentry bat character to travel from one spot to another on the game map. So it appears that the sentry bat appears at the last level finished and they march to the next level on the game map.
This is the code:
The controller (TravelMasterbk) directs the march:
GML:
draw_trail_of_bats--;
global.spacing_myTimer += 0.001;
if (global.spacing_myTimer > 1.0)
{
global.spacing_myTimer = 1.0;
}
global.spacing_myTimer2 += 0.001;
if global.spacing_myTimer2 > 1.0
{
global.spacing_myTimer2 = 1.0;
}
global.spacing_myTimer3 += 0.001;
if global.spacing_myTimer3 > 1.0
{
global.spacing_myTimer3 = 1.0;
}
if (draw_trail_of_bats <= 0)
{
//inst =
//path from grasslands to forest?
inst = instance_create(300, 371, SentryBatWalkMap);
with (inst)
{
path_start(Path53, 5, path_action_stop, 0);
show_debug_message("Spacing myTimer:" + string(global.spacing_myTimer));
show_debug_message("Path Position: " + string(path_position));
path_position = global.spacing_myTimer;
show_debug_message("Updated path_position" + string(path_position));
path_end();
}
draw_trail_of_bats = room_speed;
//a path from forest to snow
inst2 = instance_create(378, 354, SentryBatWalkMap);
with (inst2)
{
path_start(Path54, 5, path_action_stop, 0);
show_debug_message("Spacing myTimer:" + string(global.spacing_myTimer2));
show_debug_message("Path Position: " + string(path_position));
path_position = global.spacing_myTimer2;
show_debug_message("Updated path_position" + string(path_position));
path_end();
}
//open up snow level
//from snow to lava
inst3 = instance_create(464, 254, SentryBatWalkMap);
with (inst3)
{
path_start(Path55, 5, path_action_stop, 0);
show_debug_message("Spacing myTimer:" + string(global.spacing_myTimer3));
show_debug_message("Path Position: " + string(path_position));
path_position = global.spacing_myTimer3;
show_debug_message("Updated path_position" + string(path_position));
path_end();
}
}
Code:
if path_position == 1.0
{
show_debug_message("Destroying bat.");
instance_destroy();
}
Code:
___________________________________________
############################################################################################
ERROR in
action number 1
of Draw Event
for object TravelMasterbk:
invalid with reference
at gml_Object_TravelMasterbk_Draw_64 (line 90) - path_start(Path53, 5, path_action_stop, 0);
############################################################################################
gml_Object_TravelMasterbk_Draw_64 (line 90)