RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Using a Common Event to Add/Switch Equipment?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
I'm trying to rig my skills with a common event that allows them to equip weapons or armor for my Grappler class. For example 'Fist' as a weapon. The idea seemed straight forward:

Make a skill called "boxing" or "fist", occasion always, scope the user, common event: "Boxing'
make a weapon called "boxing" or "fist",

then make a common event "Boxing" that only works when called,
1: Text: Switching to Boxing
2: Change Equipment: [My Guy], Weapon = [Fist]

But when I tested it, while the text popped up, "Switching to Boxing', my Equipment list didn't display the "Fist" weapon.

What am I doing wrong?

***
Rep:
Level 82
We learn by living...
ok so i have to change weapons (weapon choice) to +1
then I have to change equipment weapon = (weapon choice)

if I don't do both, it wont load right.

I now have to figure out a way to only add the weapon to inventory once per person.

***
Rep:
Level 82
We learn by living...
Here's a simple loop for switching between three fighting styles: Brawling, Empty Hand, and Street fighting. They are represented as both weapons and as skills which call the common events.


For common event: Empty Hand
Spoiler for:
@>Text:Switching to Hand to Hand: Te
@>Conditional Branch: [Monk] is [Empty Hand] equipped
_@>Text: You are already using [Empty Hand]
_@>
 : Else
_@>Change Weapons: [Empty Hand] + 1
_@>Conditional Branch: [Monk] is [Brawling] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Brawling] - 1
__@>Change Equipment: [Monk], Weapon = [Empty Hand]
__@>
_ : Else
__@>
_ : Branch End
_@>Conditional Branch: [Monk] is [Street Fighter] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Street Fighter] - 1
__@>Change Equipment: [Monk], Weapon = [Empty Hand]
__@>
_ : Else
__@>
_ : Branch End
_@>Change Equipment: [Monk], Weapon = [Empty Hand]
_@>Call Common Event: Clean Inventory
_@>
: Branch End
@>

For Common Event: Brawling
Spoiler for:
@>Text:Switching to Hand to Hand: Brawling
@>Conditional Branch: [Monk] is [Brawling] equipped
_@>Text: You are already using [Brawling]
_@>
 : Else
_@>Change Weapons: [Brawling] + 1
_@>Conditional Branch: [Monk] is [Empty Hand] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Empty Hand] - 1
__@>Change Equipment: [Monk], Weapon = [Brawling]
__@>
_ : Else
__@>
_ : Branch End
_@>Conditional Branch: [Monk] is [Street Fighter] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Street Fighter] - 1
__@>Change Equipment: [Monk], Weapon = [Brawling]
__@>
_ : Else
__@>
_ : Branch End
_@>Change Equipment: [Monk], Weapon = [Brawling]
_@>Call Common Event: Clean Inventory
_@>
: Branch End
@>

For Common Event: Brawling
Spoiler for:
@>Text:Switching to Hand to Hand: Brawling
@>Conditional Branch: [Monk] is [Street Fighter] equipped
_@>Text: You are already using [Street Fighter]
_@>
 : Else
_@>Change Weapons: [Street Fighter] + 1
_@>Conditional Branch: [Monk] is [Empty Hand] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Empty Hand] - 1
__@>Change Equipment: [Monk], Weapon = [Street Fighter]
__@>
_ : Else
__@>
_ : Branch End
_@>Conditional Branch: [Monk] is [Brawling] equipped
__@>Change Equipment: [Monk], Weapon = (None)
__@>Change Weapons: [Brawling] - 1
__@>Change Equipment: [Monk], Weapon = [Street Fighter]
__@>
_ : Else
__@>
_ : Branch End
_@>Change Equipment: [Monk], Weapon = [Street Fighter]
_@>Call Common Event: Clean Inventory
_@>
: Branch End
@>

For the Common event: Clean Inventory
Spoiler for:
@>Conditional Branch: [Empty Hand] is in Inventory
_@>Conditional Branch: [Monk] is [Empty Hand] equipped
__@>Change Weapons: [Empty Hand] -1
__@>
_@>
_ : Else
_@>
_ : Branch End
@>Conditional Branch: [Brawling] is in Inventory
_@>Conditional Branch: [Monk] is [Brawling] equipped
__@>Change Weapons: [Brawling] -1
__@>
_@>
_ : Else
_@>
_ : Branch End
@>Conditional Branch: [Street Fighter] is in Inventory
_@>Conditional Branch: [Monk] is [Street Fighter] equipped
__@>Change Weapons: [Street Fighter] -1
__@>
_@>
_ : Else
_@>
_ : Branch End

I find this combination works pretty effectively as long as the monk doesn't unequip their weapon/style. Even if that happens, the use of a style, or even a different style will clean the inventory automatically. The only problems occur when you have more than one monk in the group or if you sell the weapon to a shop or something, it looks kind of stupid. I would like to gray-out or lock the styles in the inventory box through script of some sort, but don't know how.

Any ideas on how to make a non "droppable" or non "removable/sellable" item/weapon?

***
Rep:
Level 83
Kidfox70. It happens.
Ok, so I have a few things here. First, I don't think this is the right place to request this. Troubleshooting is more or less (from my understanding) a place for tech problems, like say if your game project just wouldn't open. This would be probably pretty posted somewhere like RMXP or RMXP Tutorials. One more thing, instead of posting like you have, which I guess is fine, I understand bumping a topic, but the way you posted...you probably should of just Edited you're first post.

The next thing I'd like to add, is that it seems the way you're going about this might be a bit much. Four Common Events, and loops. These things combined with a full or semi full game would equal lag (Meaning, that you;d most likely will have alot of Common Events and maybe some more loops). I guess it seems, to me at least, that there is an easier way. But to be honest I haven't looked into to, nor have I tryed anything. Your method seems sound, no doubt.

I think I'm going to check into this, try you're way, then try and find a new way. I hope I have and will be able to help. Cheers!
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
The way he's doing it isn't wrong either (though I can think of a slightly more efficient way that I'll explain in a second). He needs a common event per skill. If you REALLY want to create lag, do this all in one common event. That'll blow the game's mind.

To make it a little more efficient would be to add 1 more common event that is the only one that updates. Turn the rest of your common events off and make them have to be called. In that new first common event, constantly check to see if the player is pressing whatever button to check if they want to switch their stances. If the player presses the button, then pull up a choice box and the player can pick from the choices as to which stance to move to. Which ever you choose, will then activate that corresponding common event.

Example:

Conditional: IF Player Press[A]
   .Text:
          ..What stance will you change to?
   .Choices:
         ..Bare Fist
               ...Call Common Event [Empty Hand]
         ..Brawling
               ...Call Common Event [Brawling]
         ..Street Fighting
               ...Call Common Event [Street Fighting]
    ELSE
      ---

So again, you can stop having to check if the player is pressing a button from like a million different common events. Just have it check from one and use that one to then decide the rest.
« Last Edit: April 19, 2010, 04:02:17 PM by grafikal »