Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
Hello so i'm making a game where you can fight enemies, and then after a certain amount of time they respawn.
Now my friend and I (mostly him) wrote a ruby script that allowed us to have that event respawn, through an event call.
But we need to only respawn the event if the event has been erased.

We tried this...
if $game_map.events[3].erase
$game_map.respawn_event(3)
end
$end

now the respawn event works. But what happens is instead of checking if the event has been erased. It just completely erases it. which confused both of us.

we also tried $game_map.events[3].erase = true and $game_map.events[3].erase?

but obviously those did not work.
If anybody knows how to do this I would be so grateful! HERE is the script we (mostly him) wrote.
upload_2018-2-8_20-6-53.png
 

Attachments

  • upload_2018-2-8_20-6-40.png
    upload_2018-2-8_20-6-40.png
    620.9 KB · Views: 5

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
7,344
Reaction score
11,111
First Language
Indonesian
Primarily Uses
N/A
You would need to create a new method to detect if it's erased first
Code:
class Game_Event
  def erased?
    return @erased
  end
end
Then to check, you can use the method
 

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
You would need to create a new method to detect if it's erased first
Code:
class Game_Event
  def erased?
    return @erased
  end
end
Then to check, you can use the method
Thank you so much!!!!! I figured it would just be making another method but I wasn't 100% sure on where to put it (EX Class Game_Event) Thank you so much again!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
23,606
Reaction score
13,402
First Language
English
Primarily Uses
RMMZ
[move]Learning Ruby and RGSSx[/move]
 

Latest Threads

Latest Profile Posts



The project is going well, it's just I rarely share clips and stuff 'round here
I'm now free to do the game make! (sees diablo 4) Hmmmmmmm...... I'm not free!

3d Yandere RPG maker game by labylin

Forum statistics

Threads
131,773
Messages
1,223,230
Members
173,542
Latest member
talarki
Top