Event triggered by having an item?

SpookyHollows

Veteran
Veteran
Joined
Apr 15, 2015
Messages
58
Reaction score
5
First Language
English
Primarily Uses
RMMV
Back again for another question...
Is it possible to trigger an event by just having an item (or key item?) in your inventory? 
I know I saw this somewhere but...I can't recall where.
Basically, in my RPG, after you pick a collar to wear (you play as a cat) 
the collar on the sprite changes, but I'd also need the face images and story images (or pictures I put into the game) to also have the same color collar as the one you picked.
So I'm thinking, on each map or area, I'd have an event that auto runs, to check if you have that item (collar) in your inventory?
And if you have it, it will change the faces, pictures, etc before the character talks, or a story plays. 
How would I do this? Without scripts preferably...as I don't know how to install or use scripts lol 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,051
Reaction score
7,036
First Language
German
Primarily Uses
RMMV
I suggest using a common event (they work independently of maps), set it as parallel process with a wait (20) or so at the end to prevent lag and use conditional branch - equipped instead of in inventory (unless you automatically loose older collars and can't equip them)
 

thehackeryacker

Veteran
Veteran
Joined
Jan 12, 2016
Messages
44
Reaction score
9
First Language
English
Primarily Uses
@SpookyHollows


I tried this on RMMV, I am sorry i just noticed and had to edit, you are using ACE. I am fairly sure the results will be the same,


these are simple eventss. common events, and conditional branches..


You will need your characters graphics, starting and what you want it to look like after you use this item. If it is just a color change, just have the separate images.


I simply used the character generator and made the same character with blue and red. the graphic name was literally named "color, color, red guy, blue guy" for the face, character walk, and battler. You can output multiple faces to one sheet, and walk characters. This is just for those trying to conserve space for exporting down, it's better to fill up a page instead of making new ones. Set up your player/actor. I named this guy test guy, he get's used a lot. He will also be on test map, which is exactly for what it's named, testing. He started off with a blue suit, and will have two items "red suit, blue suit" to change them.

Spoiler





colorchange1.pngcolorchange2.png





Making the items that change appearance:


I made two items, you can follow these steps to add more. One red suit, one blue suit. Take note to the settings. I had these as regular item, then tested as key item, it works for both. Make it non-consumable , i set the price to 0 to keep it from being sold. Scope, the user, Occasion Main Screen. (unless you want to use a turn to change the color during battle...then you could set it to always). In the effects, select common event, we will need to set up common events after this, and repeat...

Spoiler







colorchange4.png





I named the item "Red suit" and had it call a common event, I could not make the item change a variable directly.


  I named the common event, Red suit on. I have another item with all the same settings, except for its name changed to blue suit, and it calls the next common event, blue suit on.


You can just name the one for now, and press ok when you are done to finish making the item. (we will go into common events next,


you can see I have quite a few, I just scrolled down and started new to test this)

Spoiler







colorchange5.png





With your new common event highlighted, add a new variable , and name it appropriately , I named mine simply "Which Color".


Now my test guy started out with blue, and has a red alternate. I made two common events, Blue and red, all they will do is change the Which Color variable.


On my RED SUIT, it set Which Color to 2


::control variable>xxx:Which Color> set >constant> =.2::


For the blue suit on, I change the variable Which Color on to constant = 1 .


(this means i have blue set to 1, red to 2 ,you can add more, just remember what numbers you use. You could use 3 for green , 4 for pink....)


Back to the map...

Spoiler







colorchange3.png





Now on each map you want to be able to use these items, you will need an event, set it to parallel.


Select conditional branch> variable> xxxx Which Color on > = constant = 1


  under this condition, we will change the actor graphics, so go to the third tab, and select change actor images> You can go through and select whatever graphics you want to change: face, walk, and battler. 


Add another conditional branch under the End of the first, and have it check the variable Which Color on > constant = 2.


   Set this to change the images to the next set, mine is a red character....

Spoiler







colorchange7.png


colorchang8.png





Back to your common events, Go to the next common event, and have it change the Which Color on variable, to the appropriate value.


I tested this on my test map. the character started blue, talked to an NPC who gave the two items, red suit, blue suit, each were used, not consumed, and after returning from menu, had changed graphics.


I hope this was helpful, I don't know if I am a very good teacher.


 
 
Last edited by a moderator:

SpookyHollows

Veteran
Veteran
Joined
Apr 15, 2015
Messages
58
Reaction score
5
First Language
English
Primarily Uses
RMMV
@thehackeryacker

Edit: Wait, is there a way to change multiple faces and face graphics? Do I add a..variable thing for each face graphic? And does that really change each one that is by the text that pops up?

I already have the actor sprite graphic figured out long ago, I have ADHD so it may be hard for me to explain things easier lol sorry about that, I get confused easily. 

I mean like the characters face graphics, the ones that pop up by the text whenever they speak. I have more than 1 that need to be changed to the correct collar color, but am unsure how to do that. The items are non-equipable and already not for sale nor consumable, they just sit there in the inventory after you choose it. 

I don't know if it is possible, but basically I'd need an event to change the face images, not just one though, but all, to have the correct collar colors once said collar is chosen. 

Basically I have the part down where the sprite has whichever collar the player chooses
These are how the player character faces look before picking the collar.
Tiny.png

And then these are the ones afterwards.

Tiny (PURPLE).pngTiny (RED).pngTiny (BROWN).pngTiny (YELLOW).png

 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,147
Reaction score
12,421
First Language
English
Primarily Uses
RMMV
um ... if you have to have an event to give the collar to the player, why don't you just make the event change the player's sprites at the same time?


If it only needs to be in your inventory and not actually equipped, you don't need parallel processes.


And if it's an actor graphic that you want to change, you don't need to have an event conditioned or triggered by having the item.
 
Last edited by a moderator:

SpookyHollows

Veteran
Veteran
Joined
Apr 15, 2015
Messages
58
Reaction score
5
First Language
English
Primarily Uses
RMMV
@Shaz

The first part of the game is already playable, and there is an event that changes the players sprite, but what I need is for the faces to be changed, not just one face, but all of the faces that show up next to the text each time an event has the players character talk. Basically I'm confused as to how to get all of the faces changed. Sorry, I'm not really good at explaining things. I have the character sprites taken care of already, but not the different face images.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,051
Reaction score
7,036
First Language
German
Primarily Uses
RMMV
The text commands are fixed unless you're using scripts - that includes the face selected on typing them in.


I suggest using either Yanfly's Messaging system or Modern Algebra's Advanced Text System (ATS). Both can be found at Ace' Master Script List and give you a text code to display the face of the current actor.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,147
Reaction score
12,421
First Language
English
Primarily Uses
RMMV
Ah, of course.  I wrote a little script that would show the current face of the specified actor in the message window, without you having to choose the face.  It wasn't big enough to make into its own script topic.


Put the below into its own script slot above Main.  In the Show Text command, you don't need to choose a face.  Just put \f[n] where n is the actor id (no leading zeros - for actor 5, you would put \f[5]).  It will show whatever face is assigned to the actor at the time.  The systems mentioned above by Andar are far more complicated, and might be worth looking at if this is not the only thing you want to achieve.

Code:
class Window_Base < Window
  alias shaz_ffa_convert_escape_characters convert_escape_characters
  def convert_escape_characters(text)
    result = shaz_ffa_convert_escape_characters(text)
    result.gsub!(/\eF\[(\d+)\]/i) {
      $game_message.face_name = $game_actors[$1.to_i].face_name
      $game_message.face_index = $game_actors[$1.to_i].face_index
      ''
    }
    result
  end
end
 

MrTailson

Villager
Member
Joined
May 17, 2016
Messages
6
Reaction score
2
First Language
English
Primarily Uses
   The way I see it, it sounds like there would be a ton of conditional branches in parallel processing events throughout each map for every event that were to happen, if you can deal with that crazy stuff like I can. Here's what I think it could be like for the thing you are trying to do.


   Set up each and every important event, (or at least those that have the face graphic of the player character) to use conditional branches based on a variable for what collar you are wearing. As mention before, set a common event for each type of collar to set the variable to a different number, that then changes the face graphic to that color. If I am to assume you have those faces in the exact same order for each set, Actor(0) for instance, the top-left most face, is in the same position as all the others, then you would have maybe five conditional branches for each section of text.


   Ex: If: collar color = #


   Text: [ActorName] (0)


    Your text here.


   Your text here.


         If: collar color = #


   Text: [ActorName] (0)


    Your text here,


   Your text here.


You'd have this set up for any time the player character would speak, but for each amount of text they would say. Like say, I'm only assuming,


      "That picture is crooked."


      "I'd better straighten it."


So that It would look like:


Ex: If: collar color = 0


   Text: [CatCollarNone] (0)


     "That picture is crooked."


      "I'd better straighten it."


      If: collar color = 1


   Text: [CatCollarBlue] (0)


      "That picture is crooked."


      "I'd better straighten it."


   Where collar color = 0 would be no collar, and any numbers after that would be a different color of collar. The Actor would be whatever you name it, and the number in parenthesis would be which face graphic out of the eight (0-7) you have shown for the different expressions. I'm only using CatCollar in this example to give you the idea of what face sets to use when the variable matches what color of collar you'd want it to be. Then, you'd have these two texts in where I've put (Your text here) in those two examples I used up earlier. That way, the conditional branches will read what variable is set, and then choose the appropriate face graphic for any time the character speaks. Sadly that means making tons of conditional branches for whenever the player character would speak, even to themselves, but if you're crazy enough, you might just get through it like I did. Also, sorry if none of this makes sense.
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

The end is near. The end is near. The MV era will be passed and people will look the forum about new RPG maker all days. ;_;[Election day all over again] Let accept that you will probably not what you want completely.
C&C Remastered comes out tomorrow! Hyped! Already have it preinstalled on Steam.
Its ironic, how often a person can have something smart to say, when their arrogance is originating from an internal vacuum where emotional intelligence belongs.
Parallax mapping is time consuming...
Let's purchase th... WAIT! Just in time ehehehe.

Forum statistics

Threads
98,152
Messages
949,737
Members
129,438
Latest member
Tsuna976
Top