Event System Support (expert users only)

Status
Not open for further replies.

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
You can put the player's current location (x and y position) into variables using a Control Variables command. If that's all you're asking, this is not a complex event system for advanced users - it's just "how to I obtain this game information?"
 

Sales_Kital

Digidestand
Veteran
Joined
Dec 20, 2012
Messages
30
Reaction score
2
First Language
English
Primarily Uses
RMMV
You can put the player's current location (x and y position) into variables using a Control Variables command. If that's all you're asking, this is not a complex event system for advanced users - it's just "how to I obtain this game information?"
no, that's only the first part of the complex version of what I'm asking about.  The complex version would contain hundreds of conditional branches to check "is player in this row" and then one branch per column per row.  then it would move the player to the corresponding point in the rotated copy of the map.  I'm trying to find a way to simplify this with an event at the center of the entire map acting like 0,0 instead of say 35,15(the center point of my current map I'm working with)  I am trying for more than just grabbing the player's location.  I'll attach a image of my map so you can see what I mean.

The player starts here V



and ends up here ^                          ​

What I want to know is a way to grab the players distance from the center event then invert the resulting numbers rather than doing 30x50 conditional branches for every possible square the player can be in.

The current closest coordinates to the center event would be (11,0) or (-11,0) if the center event were at (0,0)
 
Last edited by a moderator:

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
you shouldn't have to do 30X50 conditional branches, all you'd need would be to run a parallel process that constantly checks the player's coordinates in two variables and use the data from that event in the conditional that determines when you want to invert the map to determine where to send the player.
 

Sales_Kital

Digidestand
Veteran
Joined
Dec 20, 2012
Messages
30
Reaction score
2
First Language
English
Primarily Uses
RMMV
you shouldn't have to do 30X50 conditional branches, all you'd need would be to run a parallel process that constantly checks the player's coordinates in two variables and use the data from that event in the conditional that determines when you want to invert the map to determine where to send the player.
I don't have a higher understanding of scripting, and since (0,0) is the top left corner and not the center I can't just invert the coordinates(is it even possible to invert a variable from + to - in rpg maker?), I would need to check what the variable is for each possible X and each possible Y in each X to get the exact position checked and trigger the proper transfer location in the system I had originally set up with a much simpler map(straight line with only 3 y spots and only flipping not rotating)  if the map had 30 x spots the player can be in and 50 y spots then each tile would need a conditional branch relating to it to move the player to the right spot on the rotated map.  In my much simpler map where I used this method it was very slow and clunky.

The player would call the event themselves with an item in their inventory.  Right now I'm looking at tutorials for a few scripting things to try to learn a bit more about the script side of things.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,420
Reaction score
7,709
First Language
German
Primarily Uses
RMMV
(is it even possible to invert a variable from + to - in rpg maker?)
You would never invert in such a case, you would always add or substract relative differences.
That's basic mathematics, no need for anything more complex.


Let's say you have a 100x100 map and the center is at 49,49.


Current player coordinates might be 10,20 in this example.


X distance is therefore -39 and Y distance is -29


Now substract the differences from the center coordinates and you get the new player coordinates


new X = 49 - (-39) = 88


new Y = 49 - (-29) = 78


you'll need a series of control variable commands to calculate the result after getting the player X/Y-coordingates with two control variable - game data commands, but nothing more complex than adding or substracting the correct values...
 

Sales_Kital

Digidestand
Veteran
Joined
Dec 20, 2012
Messages
30
Reaction score
2
First Language
English
Primarily Uses
RMMV
You would never invert in such a case, you would always add or substract relative differences.

That's basic mathematics, no need for anything more complex.

Let's say you have a 100x100 map and the center is at 49,49.

Current player coordinates might be 10,20 in this example.

X distance is therefore -39 and Y distance is -29

Now substract the differences from the center coordinates and you get the new player coordinates

new X = 49 - (-39) = 88

new Y = 49 - (-29) = 78

you'll need a series of control variable commands to calculate the result after getting the player X/Y-coordingates with two control variable - game data commands, but nothing more complex than adding or substracting the correct values...
I think I understand, but to make sure, what I do is basically just

Set variable 5 to player x

set variable 7 to map center x(event I put in the map's center)

variable 5 subtract variable 7

variable 7 subtract variable 5

transfer player to x of variable 7

and only have it run when the player uses the item as well as doing the same for player y

right?

I tested, and it worked, thanks for the help this really streamlined the map rotation for me.  now I just gotta make something to show the indicator to the player.
 
Last edited by a moderator:

vintb1987

Villager
Member
Joined
Jan 21, 2014
Messages
12
Reaction score
0
First Language
English
Primarily Uses
I have a question. Could you describe a new battle system to me, I am decently familiar with how the eventing works and would love to give it a try so I wouldn't need a script. I wanted to run something like tactical battling from final fantasy tactics and I have see the scripts for this effect, and have demo'd them. Which they are awesome, but I would still like to put my own custom ideas into motion. Can you help me?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Something like that could be fairly involved. Can you make a separate thread for it, and tell us what you've done so far? We usually expect people to at least have a go before they ask for help.
 

vintb1987

Villager
Member
Joined
Jan 21, 2014
Messages
12
Reaction score
0
First Language
English
Primarily Uses
Well, to be honest. I just wanted to see if anyone would be interested in giving me some feedback before I got started. Because all of the information about it can help, I understand on the starting it first, so I will start it sometime and then post again.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
This thread is for complex systems that you've started and need help when you've run into a problem, not for people to actually give you ideas. That would be more suited to Game Mechanics Design, if you just want to talk about how it will all work, and not about the actual implementation.
 

vintb1987

Villager
Member
Joined
Jan 21, 2014
Messages
12
Reaction score
0
First Language
English
Primarily Uses
Ok, I would be interested in how it would work. Yes, that is more of what I wanted to know, sorry.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
We help when you're stuck, we won't tell you how to do it. Try and figure something out yourself first, get something done, and then come back and post in this thread. Again, this is for expert users.
 

GammaVector

Veteran
Veteran
Joined
Feb 12, 2014
Messages
117
Reaction score
49
First Language
English
Primarily Uses
RMMZ
EDIT: Nevermind, I'm an idiot. It's amazing what taking a break and having a meal will do for one's brainpower.
 
Last edited by a moderator:

TSED

Underfoot
Member
Joined
Feb 12, 2014
Messages
28
Reaction score
9
First Language
English
Primarily Uses
Hoo boy.  Here we go.

I am trying to set up a summoner type class.  One of their skills makes use of Tsuki's enemy summon script.  It creates a bomb (called a 'splodey') which uses a skill that damages itself.  The damage is then stored in a variable and when it dies it calls a common event (Yanfly's death common event script) that causes yet another skill to be used on enemies that deals damage equal to the amount it did to itself.  The basic order of operations is as follows:

Skill is used -> Call common event -> script call (add enemy) -> Splodey damages itself every turn until it dies -> on-death common event forces an actor in the party to cast the 'nuke' spell -> damage is applied and the damage variable is set to 0.

The thing is... it works!  It's just that there's got to be a more efficient way to force the nuke than this:

 
Last edited by a moderator:

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
@TSED Normally when I have skills that take effect upon death I use events for processing the skills rather than force action. (Using play animation + strait damage dealing and so forth to imitate using a skill but without having to use every possible character combo to force an action in order to use it). You could also make your 'splodey' immune to the death status and have an event in each battle it's in (or use a script that allows you to have common battle events, of which Yanfly at least has made one) with a span of moment and the condition that splodey's hp = 0% that forces splodey itself to use the skill and then applies the death status to it. Just a couple of options that should clear up the endless conditionals.
 

TSED

Underfoot
Member
Joined
Feb 12, 2014
Messages
28
Reaction score
9
First Language
English
Primarily Uses
@TSED Normally when I have skills that take effect upon death I use events for processing the skills rather than force action. (Using play animation + strait damage dealing and so forth to imitate using a skill but without having to use every possible character combo to force an action in order to use it). You could also make your 'splodey' immune to the death status and have an event in each battle it's in (or use a script that allows you to have common battle events, of which Yanfly at least has made one) with a span of moment and the condition that splodey's hp = 0% that forces splodey itself to use the skill and then applies the death status to it. Just a couple of options that should clear up the endless conditionals.
Hmmm.  I have seen mention of that script before and really probably should pick it up.  I've been avoiding it as I already have a good number of scripts and am worried about introducing something incompatible but not noticing it for a while.  Ehhh, most of what I have is Yanfly anyway so I might as well.

I did have the "Change Enemy HP" option originally, but I had to work around it because it doesn't seem to have the damage float numbers pop up (from... Yanfly's core engine, I think?).  It'd seem weird to have that explosion without all the fancy numbers accompanying it.

Anyway, off to check out that battle-common-event script.
 

Honinbou

Villager
Member
Joined
Jun 9, 2013
Messages
6
Reaction score
0
First Language
Portuguese
Primarily Uses
Hi everyone.

I'm trying to make a Naval Battle System (Board game) and I have some questions about how can I improve it.

System Screen: http://i.imgur.com/L0TsIya.png

My questions:

1 - How could I reduce the number of events on the map? (Every event checks if the tile was attacked, so it won't attack there twice)

2 - How could I reduce the event of IA's attack? It's really huge and I can't customize the rest of the system. By customizing, I mean: Special Effects (like "super powers", so the IA can attack twice on his turn or he can automatically hit one of your ships)...

3 - Is there a way to make this system work using Terrain Tags without scripts?

4 - How can I make the IA's attack stick inside the tileset? (Reminder: don't forget about the 1st question)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
You haven't shown us what you've done yet :) We can't help you "improve" something if we can't see how you've done it.
 

Honinbou

Villager
Member
Joined
Jun 9, 2013
Messages
6
Reaction score
0
First Language
Portuguese
Primarily Uses
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

This is relevant so much I can't even!
Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect

Forum statistics

Threads
105,996
Messages
1,018,216
Members
137,777
Latest member
Bripah
Top