Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
Hello! I am hoping this isn't something that is extremely complicated, but I am looking for a script that will make it so when 2 NPCs touch, one NPC's graphic will change, but I don't want the same thing to happen when the player touches the same NPC.

For instance a bus, I want it to touch an NPC and the NPC goes into the downed position, and/or switches event pages either through self switch or regular switch. I would like it to be arranged also that when the player touches the NPC, it does NOT go into the downed position.

Thank you for your help! I greatly appreciate it.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
Last edited by a moderator:

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
So if I put this script in my game, and the script call, it will make one NPC/event trigger another upon collision?

If I were to use my example of Bus vs. Body, in which event would I put the script call? In the bus? Or the NPC?

(This game quickly got out of control on scripts, I am hoping I don't run into compatibility issues! :guffaw: )

Edit:
Sorry, its 12:21 here, and I am not a script wizard to begin with. Thank you for your help!
 
Last edited by a moderator:

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
nope. that script only gives you 2 trigger options.

the script call will allow you to trigger an event anywhere and you don't need that script for it. it's actually a built-in function of the default game engine itself.

you will need scripts like events collision or using line of sight eventing to if you wish to make events collide/detected.
 

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
Ok, one more noob question: What I am looking for is when an event touches another event, I want it to trigger a self-switch on one or the other event. If a player touches the same event, I want nothing to happen. Will this script provide different behaviors for when my player touches the event vs an event?
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
if that's the case, you don't really need a script for that.

what you need is a simple game variable/switch and a conditional branch in the page to do the trick.

the event(bus) using the "spot" should do the trigger along with a game variable change or flip a switch before doing the script call to start the downed npc so the triggered event will run the commands.

when directly triggering it using the game player, the game variable and switch isn't there so it will simply ignore the player and do nothing.
 

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
I'm sorry if I am dense, but I don't follow. What "Spot"? I am going to have moving obstacles, I want the bus to deal damage to the player, and down any other NPC sprite that collides with it. But I don't want the sprite to be active on player collision.

I hope I don't seem ingrateful, I really appreciate your help on the matter!
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
Then you are looking for an ABS system.

There should be a few in the master script list.

edit:

"spot" means if the bus "spot" the npc by line of sight, it will proceed to run the control game variable/switch then run the script call to trigger the npc event.

http://forums.rpgmakerweb.com/index.php?/topic/3452-direction-based-line-of-sight-events/

instead of checking for $game_player, check for $game_map.events[id]

id = the event's id in the map

edit again:

half asleep and isn't thinking straight. you don't have to trigger the event if you want to change its graphic. just use this script call when npc is spotted by the bus

$game_self_switches[[map_id, event_id, "A"]"A" can be changed to B/C/D/E for self switches.
 
Last edited by a moderator:

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
Lol, I bookmarked that Line of Sight tutorial, I will have to get into that tomorrow. I am using Falcao's Liquid Pearl ABS v3.0 and I was going to have automobiles damage the player and "down" NPCs when they were touched. Then have the NPCs react differently as enemies and die to the players weapon, or instantly downed by a bus/automobile.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
if you are already using an ABS, then it should already provide you a way to check for event-event collision.

simply do that self switch script call when events are colliding.

Or make your bus a projectile that won't perish. so it will be hitting everything in it's path.

i am not sure if falcao abs allow the creation of neutral(3rd battle party) bullets, but it's worth trying.
 
Last edited by a moderator:

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
hehehe, I have no idea, either, on where to even begin. I don't know very much about scripting, but it seems to be that the projectiles are Skills called via a script call. I will contact the Script's author and see if he is not too busy. Thank you again for your help.

Edit:
haha, I am thinking I could have an invisible event summon the automobile skill?
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,888
Reaction score
8,240
First Language
German
Primarily Uses
RMMV
event-to-event triggers are a lot more difficult to handle than you think, which is why most such interaction is on command only - which is only possible if you know in advance that two events will interact at a specific time and place.


That start-event-command is also a command to start now, it does not wait.


If you want event-to-event triggers, you basically have to check the position of all involved events and trigger if they are in a position that they're touching each other.


And that will cost a lot of processing power, which is why it's usually done for a limited number of events with parallel processes only.


There is another way to enable such a collision check, but that other way would require big changes in the data structure for the maps and still require more processing power than is used now - which is why I haven't seen any implementation of it in any RM game. It's simply a lot of work to rewrite that.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
haha, I am thinking I could have an invisible event summon the automobile skill?
that might just do the trick. ;)

There is another way to enable such a collision check, but that other way would require big changes in the data structure for the maps and still require more processing power than is used now - which is why I haven't seen any implementation of it in any RM game. It's simply a lot of work to rewrite that.
he's using ABS to build his game. that part is already rewritten by the abs i believe.

and event collision check is already a constant running process in the default engine. just need to redirect it to where we need using a condition check i guess. but i am too tired to look into it for now. might be able to make a quick script to check collision based on name tags. will have to wait till i am in a more sober state. :p

edit:

this allow the event with the name tag <eet> to trigger any events with the name tag <eer> it came into collision with, and will trigger itself when it came into collision with player.

Script link: http://forums.rpgmakerweb.com/index.php?/topic/53173-event-to-event-trigger/
 
Last edited by a moderator:

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,744
Reaction score
703
First Language
Americanese
Primarily Uses
RMVXA
Oh man! Thank you! I am going to try this out now... Fingers crossed that I don't break any compatibility and lag is minimal! Thank you again, I will let you know how it works in about 5 mins or less!

WOW! Preliminary testing reveals this script to be AWESOME! I can not begin to tell you how happy I am about this! This opens up a whole new dimension of game design. Incredible! Just incredible! I might have to put a demo up of my game sooner than later, I am impressed! I wish I could give you more than gratitude, but all I can offer is some time playtesting your game or giving feedback. Got a link?
 
Last edited by a moderator:

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
oh don't worry about lag, it's using the default engine's collision check. it's a process that's already running in the background.

edit:

but i am not sure about compatibility when it comes to abs. it works fine on the default engine. so you will need to try that out.

theoretically, it should be fine if you put this script below your abs script.

edit again:

there seems to be a problem with the lock down with the default event start.

the triggered event will turn and face the player instead of the event that triggered it. it's fixed now.

i've also added a 3 second timer to freeze the triggering event so that it won't go happy spamming the trigger.

http://forums.rpgmakerweb.com/index.php?/topic/53173-event-to-event-trigger/
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Stop shutting the damn power down! Why always like this
Working on a slightly experimental horror game. It will be finished in approximately 88888888888 years.
Y'all will enjoy it though, I put lots of effort into making it stand out.

It's called Red Light and it's inspired by another obscure RPG Maker horror game, but I don't want to give too much away just yet.
Ohh man, Weapon animations plugin feels so mandatory. Seeing that same image regardless of the icon of the weapon....ugh :p
Ok so......Maaaaybe I've taken a ''little'' bit of inspiration from FF9 when it comes to battle hud xD

ff9.PNG

Just maybe....

Forum statistics

Threads
112,354
Messages
1,067,711
Members
146,004
Latest member
Faxify
Top