When I load the save file, it claims that "generated" is not a known variable. It was declared in the create event. The room it is in is persistent. It'll also say "day" is not a known variable.
Information about object: obj_coconut_tree
Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Create Event:
execute code:
depth = -y
image_speed = 0
image_index = 0
visible = false
tree_life = 1 //tree is alive
//Checks if plant is on the island
generated = 0 //hasn't been generated
Step Event:
execute code:
depth = -y
//Reveals plant after placement is finished
if (generated = 1) {
sprite_index = spr_coconut_sapling
visible = true
}
//Checks if plant is on the island and if place is free
if (generated = 0) {
if not (place_free(x,y)) {
x = random(236)
y = random(150)
move_snap(16,16)
}
if ((place_meeting(x,y,obj_tulip)) or (place_meeting(x,y,obj_rose)) or (place_meeting(x,y,obj_pansy)) or (place_meeting(x,y,obj_cosmos)) or (place_meeting(x,y,obj_coconut_tree))) {
x = random(236)
y = random(150)
move_snap(16,16)
}
if not (collision_point(x,y,obj_island,true,true)) {
x = random(236)
y = random(150)
move_snap(16,16)
}
if (collision_point(x,y,obj_island,true,true) and (place_free(x,y))) {
move_snap(16,16)
if not ((place_meeting(x,y,obj_tulip)) and (place_meeting(x,y,obj_rose)) and (place_meeting(x,y,obj_pansy)) and (place_meeting(x,y,obj_cosmos)) and (place_meeting(x,y,obj_coconut_tree))) {
generated = 1
}
else {
x = random(236)
y = random(150)
move_snap(16,16)
}
}
}
execute code:
//Tree growth
if (ctrl_time.last_day<ctrl_time.day) { //if over a day has passed
if tree_life = 1 { //if tree is alive
sprite_index = spr_coconut_tree //sapling becomes tree
if (image_index<3) { //if tree isn't full grown
image_index += (ctrl_time.day-ctrl_time.last_day) //numbers of days passed equals growth
if (image_index > 3) { //if numbers of days is over full grown
image_index = 3 //tree remains full grown
}
}
}
}
This is the time script.
Information about object: ctrl_time Sprite: spr_control Solid: false Visible: false Depth: 0 Persistent: false Parent: <no parent> Mask: <same as sprite> Create Event: execute code: second = current_second minute = current_minute hour = current_hour day = current_day year = current_year weekday = current_weekday month = current_month last_day = current_day last_hour = current_hour last_month = current_month Step Event: execute code: second= current_second minute= current_minute hour= current_hour day= current_day year= current_year weekday= current_weekday month= current_month Other Event: Game End: execute code: last_day = current_day last_month = current_month



Find content
Not Telling




