Make an event the same on every map

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
I have a projectile event that can be shot by the player. This is event is essentially relocated to the players location from a hidden place on the map. It works well, however, I call it up from a Common Event, so the event number 005 will change on each map. I realized this is a problem because the projectile would have to be 005 on every map, otherwise it's calling the wrong event.

My solutions are either make the projectile 005 on every map, which is tedious and annoying, or make an event for every map instead that calls its particular instance, as opposed to a common event.

Does anyone have another solution that may be easier? Thanks!
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
947
Reaction score
2,213
First Language
Not English
Primarily Uses
RMMV
Are you using a plugin for the projectile?What I suppose you can do is-
1. Use a script call like $gameMap.event(this.eventId()) in the common event to indicate the projectile event so that it doesn't have to be a fixed event.
2. Use an event spawner so that the event can just spawn in every map. In this case, you don't need a common event (since it's the same event across multiple maps)

Edit: I just notice it's in the game mechanics design section. But I assume you use MV. So my answer is for RMMV.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@PKirkby Game Mechanics Design is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using.

[MOVE]RPG Maker MV[/MOVE]
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Maybe use Event Id1 on each Map. It's the easiest and less work intense solution.

Other solution could be:
Checking all 999 Event Ids, 1st condition to see if event id exist, 2nd condition to check if the Event Name contains for example the Word: Bullet.

Or in your Code you make a branch for every map ID, and in it you change a Variable to the correct number, which later represents the corect event id for the map to use.
 

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
@PKirkby Game Mechanics Design is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using.

[MOVE]RPG Maker MV[/MOVE]
Thank you
 

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
Are you using a plugin for the projectile?What I suppose you can do is-
1. Use a script call like $gameMap.event(this.eventId()) in the common event to indicate the projectile event so that it doesn't have to be a fixed event.
2. Use an event spawner so that the event can just spawn in every map. In this case, you don't need a common event (since it's the same event across multiple maps)

Edit: I just notice it's in the game mechanics design section. But I assume you use MV. So my answer is for RMMV.
No I'm not using a plugin for it, however those are good ideas. Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You could use a specific event name on every map, even if they have different ids. Then make your common event search through the map events for the ONE event with that name, and that is the event (and event id) that will be used for that map.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
making events on the fly, by code, is possible.
I don't know about them coming from a common event, tho.... or, available without a refresh of the map...... but it is possible.

however, if what you're doing is a projectile, it might as well be a projectile object (a custom object, made by you, by code) which could simply be a sprite, *which*, would be available on demand from anywhere without requiring an extra refresh.
(I mean, it requires one, but the map would take care of it)

if you're using an event because that's your only way of obtaining a source and destination position, and a path between them,...... you can also do that with a sprite.

for the purposes of shooting a frame of a picture between two points, an event is overkill, because the event carries with itself the ability to run code, and check for global variables, which you don't even need.
 

Martin

Veteran
Veteran
Joined
Apr 8, 2015
Messages
191
Reaction score
46
First Language
swe
Primarily Uses
RMMV
You can make your event set it's ID to a variable (via control variables) and use the variable where you need it.
Then your event will update the variable ID on every mapload if you want
 

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
Maybe use Event Id1 on each Map. It's the easiest and less work intense solution.

Other solution could be:
Checking all 999 Event Ids, 1st condition to see if event id exist, 2nd condition to check if the Event Name contains for example the Word: Bullet.

Or in your Code you make a branch for every map ID, and in it you change a Variable to the correct number, which later represents the corect event id for the map to use.
Yeah, I suppose I could also make it event 999 everytime, since I've already used up
You can make your event set it's ID to a variable (via control variables) and use the variable where you need it.
Then your event will update the variable ID on every mapload if you want
Hey that's a good idea, I will consider that, thanks!
 

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
making events on the fly, by code, is possible.
I don't know about them coming from a common event, tho.... or, available without a refresh of the map...... but it is possible.

however, if what you're doing is a projectile, it might as well be a projectile object (a custom object, made by you, by code) which could simply be a sprite, *which*, would be available on demand from anywhere without requiring an extra refresh.
(I mean, it requires one, but the map would take care of it)

if you're using an event because that's your only way of obtaining a source and destination position, and a path between them,...... you can also do that with a sprite.

for the purposes of shooting a frame of a picture between two points, an event is overkill, because the event carries with itself the ability to run code, and check for global variables, which you don't even need.
The only thing is, the projectile has multiple pages, each projectile will have different effects and speeds etc. However, I suppose I will have to create multiple common events for all of those anyway. How would I go about using a picture as a projectile, and how would I set collision detection for it?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
the actual projectile is one: the one sprite shot from a point towards another point.
that one projectile, can have properties like any other object.

if you make the object yourself, you define what you want.

if your problem is making the thing move and that's the reason why you're using an event relying on it's move route, then that specific aspect can be taken in, and made into it's own object, separate from the definition of event.
it would be a *projectile* object, not an *event*.... and it'd work differently, and have different properties, but all that can be made to specification if you write it from scratch.

by your definition it seems you're making something like an action battle system.
there are plugins for that.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Yes Martins Idea is good.
Have a Parallel Event on each Map with the code:
control variable1 = Event ID of the Bullet Event on this Map. For example: 5 on Map id1 and 23 on map id 2.
Erase Event Eventcommand, thisway the Event only runs one time every time the map is entered/loaded.

The Bullet Object sounds interesting. Is this only 4 directions or are you planning for 16 or more direction angles?
For 4 Directions using an Event seems more flexible and simple, for more directions/angles, it seems to become very difficult using Events. Because you cant Move them very flexible diagonaly towards 2 points while being able to erase the picture on collision. Sadly Picture Bullets have Problems when the Map starts scrolling.
Maybe a fix Picture to Map Plugin can also be used to Move pictures while they are fixed on the map grid instead of game screen??? Than the Picture would be his Bullet Object, and the collision code would be handlet in one of the Events. But it could turn out Animating a Picture is difficult, animating an Event was easy.
Edit:
What if the Bullet suddenly is a Fireball?
- Events could be animated.
- You could Play a Database Animation of a not moving but animated Fireball ontop of a Moving Event which has no Graphic and represents the Bullet.
- Not sure how easy it is to Animate Scripted Bullet Object. (Would be interested to see more of that solution also, just mentioning my thoughts about this in General maybe it helps Brainstorming)
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

@PKirkby , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.


Please quote all posts in a single post, or better, to address someone specifically, use the @ symbol followed by their username, as I've done in this post.
 

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
Yes Martins Idea is good.
Have a Parallel Event on each Map with the code:
control variable1 = Event ID of the Bullet Event on this Map. For example: 5 on Map id1 and 23 on map id 2.
Erase Event Eventcommand, thisway the Event only runs one time every time the map is entered/loaded.

The Bullet Object sounds interesting. Is this only 4 directions or are you planning for 16 or more direction angles?
For 4 Directions using an Event seems more flexible and simple, for more directions/angles, it seems to become very difficult using Events. Because you cant Move them very flexible diagonaly towards 2 points while being able to erase the picture on collision. Sadly Picture Bullets have Problems when the Map starts scrolling.
Maybe a fix Picture to Map Plugin can also be used to Move pictures while they are fixed on the map grid instead of game screen??? Than the Picture would be his Bullet Object, and the collision code would be handlet in one of the Events. But it could turn out Animating a Picture is difficult, animating an Event was easy.
Edit:
What if the Bullet suddenly is a Fireball?
- Events could be animated.
- You could Play a Database Animation of a not moving but animated Fireball ontop of a Moving Event which has no Graphic and represents the Bullet.
- Not sure how easy it is to Animate Scripted Bullet Object. (Would be interested to see more of that solution also, just mentioning my thoughts about this in General maybe it helps Brainstorming)
I've got it firing in 8 directions right now, with some help of course. My goal is to eventually get more directions, but I'm working on getting a plugin that fires at mouse position. GALVs Map Projectiles does this fairly well, but it's limited in some ways for me, so I'm doing most of it with events. Seems to work pretty good so far.
 
  • Like
Reactions: Bex

PKirkby

Veteran
Veteran
Joined
Oct 26, 2019
Messages
157
Reaction score
18
First Language
english
Primarily Uses
RMMV
[DPOST]@PKirkby [/DPOST]
Please quote all posts in a single post, or better, to address someone specifically, use the @ symbol followed by their username, as I've done in this post.
Oh, I thought if I replied to them directly that would respond to just them, thanks.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
@PKirkby Okay, so, you’ve just double posted again. That means to make one or more posts in a row with no one responding in between.

If you really feel the need to quote someone, hit quote on each post, then insert them in the reply box. It will insert them all at once. But really, most of the time, quoting is not necessary. Just mention them by using the @ symbol like I’ve done here.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top