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
6,859
Reaction score
9,258
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
22,865
Reaction score
12,410
First Language
English
Primarily Uses
RMMZ
[move]Learning Ruby and RGSSx[/move]
 

Latest Threads

Latest Profile Posts

Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive :D
Finding new interesting stuff to make for the resource calendar becomes harder every year D:
ScreenShot_8_19_2022_2_3_18.png
FINALLY got the mood system in the game during battle. Since the game is called Panic Attack, I figured you should have certain moods present including Panic. so the main 3 or Hype, Depressed, and Anxious. Panic is only when stunned.

Forum statistics

Threads
124,704
Messages
1,165,381
Members
163,517
Latest member
Azora
Top