Master Cabalist
Member
This might be a bit off topic but I have a parent brain that is a parent for all. Its not physically in the game screen. . As soon as the desert brain spawns, it says:
Now,
This is a snippet:
I know its long and complicated, but it is what it is.
GML:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object SpecialtyBrain:
global variable name 'current_brain_specialty_target' index (101260) not set before reading it.
at gml_Object_SpecialtyBrain_Step_0 (line 4) - hp -= global.current_brain_specialty_target
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_SpecialtyBrain_Step_0 (line 4)
called from - gml_Object_DesertSpecialtyBrain_Step_0 (line 67) - event_inherited();
is initated the create event already.hp -= global.current_brain_specialty_target
This is a snippet:
Code:
alarm[4] = room_speed/4;
hp -= global.current_brain_attack_target_damage
global.current_brain_attack_target_damage = 0
///////////////PAIRING///////////////////
//////////////////////////////////////////
attackRange = 50;
flyspeed = 5;
floater_myTimer--;
//if attackTarget is empty
if (!instance_exists(attackTarget))
{
//player presses mouse left
if (mouse_check_button_released(mb_left))
{
//get a bat (was get a bat, now its brain parent
attackTarget = instance_place(mouse_x, mouse_y, BrainParentObject);
//show_debug_message("Brain is attacking is : " + string(BatParentObject));
}
}
//make sure thqt attackatarget has a reference
if instance_exists(attackTarget)
{
//When decision_timer is set, count down the timer and clear the attackTarget and attacking
if decision_timer > 0
{
decision_timer--;
if (decision_timer == 0)
{
//brain is no longer attacking
attackTarget = noone;
attacking = false;
}
}
else if distance_to_object(attackTarget) > attackRange //DECISION TIMER IS 0 AND BRAIN IS NO LONGER ATTCKING
{// BRAIN DISTANCE FROM BAT IS > attackRange
//Far from brain, move towards it
//{
if attacking == false //set attacking to false and
//move towrds bat
move_towards_point(attackTarget.x,attackTarget.y, flyspeed);
//}
//Note: You could have the decision_timer code under an else-conditional here,
//which would allow ranged brains to keep attacking until the bat leaves its range
}
else //BRAIN DISTANCE TIMER IS 0 AND BRAIN IS CLOSE TO BAT
//LOCKING IN
//assign attack target
//or move towards target
//or lock in battle
{
//LOCK IN BATTLE
attacking = true;
speed=0;
//locked in
//if global.colliderbat_temp exists
//attackTarget is assigned to global.colliderbbat_temp
if (instance_exists(global.colliderbat_temp))
{
attackTarget = global.colliderbat_temp;
show_debug_message("Brain locked onto attackTarget");
}
}
} //end instancfe exits attacktarget
else
{
attacking = false;
//attackTarget = noone;
decision_timer = 0;
}