Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Click here to join us on IRC (#charas on irc.freenode.net)!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
RM2k3 Help--Skill that consumes items?
« previous
next »
Print
Pages: [
1
]
Author
Topic: RM2k3 Help--Skill that consumes items? (Read 3862 times)
Igavustunne
This ends now!!! INDIGNATION!
Initiate
Posts: 15
RM2k3 Help--Skill that consumes items?
«
on:
December 02, 2009, 09:07:28 PM »
Okay, so, as some of you may have read, my game has a chef character in it that is the first healing character you get. Mainly just to avoid the cliche of a cleric or priest... aaaaaaand I like to beat up enemies with a frying pan. X3
I've been experimenting on and off for the last couple of days trying to get just one of the skills to work. Here is an idea of how I want it to work:
IN BATTLE
You hit the button [Skill] and select the move. Let's say that the first recipe is fruit salad. The game then runs an event-based skill that goes into your inventory and checks for one of each of the following ingredients: Peach, Strawberry, Grape, Banana. If you have at least one of each, the skill CAN BE USED. Otherwise it is deactivated. If you use the skill, an event subtracts one of each of the ingredients that are required, and heals the entire party for 15% of their health. The event plays a healing battle animation on all party members while playing a restoration sound effect, and the event ends. For different recipes, the time that it takes to cast the skill will be longer, so I want that as a variable as well.
NOT IN BATTLE
You select the chef party member and use one of her event-based skills outside of battle. The game runs an event-based skill which works exactly the same as the last one, minus the battle animation.
--------------------------------------------------------------------
I've been trying to get this to work, but I'm not particularly fluent with the in-game programming language of RM2k3, so it's very hard for me to do this. I understand I will need to make an individual event for each recipe, but I'm not worried about that. As long as I have one working example, I can get the rest of it easily. Here is the code that I have right now: (It doesn't work right now)
Erm... Well... I would post my code too, but I don't know how to copy and paste that in here... So until I figure that out, or someone tells me, anyone who can help me with this dilemma will make me very happy. Thanks in advance.
Logged
"Hello, this is Cy Greenbloom, president of Spatula City. I love their spatulas so much... I bought the company."
Rowan
...
Zealot
Posts: 601
Charas arbitrary gay black guy.
Re: RM2k3 Help--Skill that consumes items?
«
Reply #1 on:
December 02, 2009, 11:08:20 PM »
Press PrtScrn key on your keyboard, then open MSPaint and paste.
Logged
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: RM2k3 Help--Skill that consumes items?
«
Reply #2 on:
December 03, 2009, 01:37:59 AM »
This shouldn't be too hard in theory.
Let's begin.
You'll need:
1 skill
1 battle event
2 common events
1 switch
1-3 variables
Create a skill called "Cook:Salad"(or someting). The skill will be a Switch. Make it activate a switch called something memorable like "Fruitsallad".
Next lets go to the battle groups.
Make a battle event triggered by the switch is on.
Make it call for the common event.
-----------
Preperations are done. Let's make the hard stuff.
"What common event should we call for?" Well it doesn't exist yet. But we'll create that common event now:
Let's start of by adding conditional branches. it will look like this:
Branch: Party posseses "Fruit1"
Branch: Party posseses "Fruit2"
Branch: Party posseses "Fruit3"
(keep doing this untill you got all the neccessary items in it)
Change item: Fruit1 1 remove
Change item: Fruit2 1 remove
Change item: Fruit3 1 remove
(keep doing this untill you got all the used items removed)
Play sound effect: "HEAL ME!"
Show Battle animation: "HEALING"(Make it global)
(Now for the variables)
Variable operations: "Hero health" Set. Hero1 MAX hp.
wait 0,1sec
Variable operations: "Hero health" Multiply by 15 (it's the percentage)
wait 0,1
Variable operations: "Hero health" Divide by 100 (So it's actually 15%)
Change HP: Hero1 - VAR[Hero health] recover.
End
End
End
----------------------------
So. The conditional branches checks for the needed items. Then you subtract the items from the inventory. Play the sound, show the battle animation. set varaible equal to max health. use math to edit the varaible into 15% of the max health. Use the "change hp" event command and make it increase by the value of the varaible "Hero health".
Then do the same thing for the other characters. AS in. The entire Variable part can be copied and pasted below the first one. only you change the start from HERO1 to HERO2 and the end for whom is healed.
I think you get it.
----------------------------------
So. 2 things left.
First enter the battle event and fix that "call common event" thing so it actually calls the cooking event. And remember to turn the switch off.
Now create a new common event. Make it be a "parrallel process" and insert the switch as a trigger.
This way the same thing will play even though you are not in battle. Well soon enough.
Simply add two event commands: Call event and choose the cooking common event.
And turn switch off.
It should work. But you might neeed to tinker around with it some. Good luck!
«
Last Edit: December 03, 2009, 01:39:36 AM by Prpl_Mage
»
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
Igavustunne
This ends now!!! INDIGNATION!
Initiate
Posts: 15
Re: RM2k3 Help--Skill that consumes items?
«
Reply #3 on:
December 03, 2009, 02:49:02 PM »
Awesome, thanks! It works really well. There is one problem, now, though, the spell actually healed each party member for 9999999 each, which last I checked was higher than the variable system allowed. I may be wrong. Did one of the variable operations bring the number as high as it did?
Also, I was doing this on a test battle with a bunch of weak enemies. So after using the spell to heal the entire party for 9999999 each, I killed the enemies for no reason, and for some reason, every time one of the enemies died, the party was healed for 9999999 again. I think I have a hunch as to what the problem may be, but if it doesn't work, any suggestions?
EDIT: Fixed the enemy death heal. Switch problem.
But it still heals everyone for 9999999
Okay, now I'm having another two issues:
Outside of battle, the battle animation shows, but it doesn't show it in battle. This confuses me.
Also, when I use the skill outside of battle, it exits the menu everytime I use the skill. Does it have to be that way? I'd like to see it heal so I can use it again almost immediately if I have to.
«
Last Edit: December 03, 2009, 03:04:11 PM by Igavustunne
»
Logged
"Hello, this is Cy Greenbloom, president of Spatula City. I love their spatulas so much... I bought the company."
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: RM2k3 Help--Skill that consumes items?
«
Reply #4 on:
December 03, 2009, 10:31:17 PM »
For the issues. the 99999 problem... Did you make sure that it is a "change hp" and not "Complete healing"? Otherwise you might have done something wrong with the variables. I just tried it myself and the character with 385 hp gets healed for 57. (387x15= 5775. 5775/100= 57,75. RPGM can't handle things beyond the decimal thingy so only 57 remains)
And for the battle animation - yeah kinda noticed that too. The thing is this. Since the animation is supposed to play at an event location and no events exist in battle - the animation takes place outside the screen. Exactly where it takes place is beyond me but the tint and shake screen appear in battle.
You can either have it activate another switch that triggers a battle event that plays the battle animation. Or put it into the first battle event that activates the common event.
And for the last problem - calling common events do that since common events can't take place in the menu. So when activating the switch and all - it needs to exit the menu in order for the common event to play. So yeah... No idea how to get rid of that.
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
Igavustunne
This ends now!!! INDIGNATION!
Initiate
Posts: 15
Re: RM2k3 Help--Skill that consumes items?
«
Reply #5 on:
December 04, 2009, 12:55:51 AM »
Yes, it was a math error. The huge number of health healing thing came from me not pushing multiply instead of divide. If I had known that, then that would be a whole lot less trouble. ^^"
I fixed the battle animations, and I'm going to use it like that for every skill.
The menu issue I fixed by displaying a message after the event takes place which says "Party has been healed for 15% HP." Or something like that. I tried toying with the event a little bit to see if I could get there to be "else's" on each conditional branch which stop the event with a message that says "Not enough ingredients," but what happened instead was that even with no loop, the message plays over and over and over again, and even if you press enter, escape, x, or z, the message keeps continuing on rolling over and over again. I'm trying to fix that, but it's really hard without being able to see the loop which isn't there.
In order to save time, do you think it would work to place every recipe skill into a single battle event that calls the event? I mean for use in battle. That way all I have to do is copy the page that has all of the recipes and the event calling, and then paste it into every battle scene there is.
«
Last Edit: December 04, 2009, 01:29:29 AM by Igavustunne
»
Logged
"Hello, this is Cy Greenbloom, president of Spatula City. I love their spatulas so much... I bought the company."
Igavustunne
This ends now!!! INDIGNATION!
Initiate
Posts: 15
Re: RM2k3 Help--Skill that consumes items?
«
Reply #6 on:
December 06, 2009, 10:38:27 PM »
Here goes my one bump. Post above has the last few questions.
Logged
"Hello, this is Cy Greenbloom, president of Spatula City. I love their spatulas so much... I bought the company."
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: RM2k3 Help--Skill that consumes items?
«
Reply #7 on:
December 07, 2009, 08:33:50 PM »
To answer the question. Yes you can use the same 2-3 events for the entire cooking book. Just use a variable for the recipes.
so for exampple . fruit sallad is recipe 1(Variable : Cook = 1)
beef stroganof is 2 (Var = 2)
tenderlions are 3(Var=3)
ect, ect
Then in the event, put a conditional branch at the top that checks which variable in on. Then depending on that plays different item checks(ingredients) and the heal and all that.
and for the message. Remember to change the switch and a "End event proccessing. otherwise it will loop forever or such.
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
Igavustunne
This ends now!!! INDIGNATION!
Initiate
Posts: 15
Re: RM2k3 Help--Skill that consumes items?
«
Reply #8 on:
December 07, 2009, 09:50:21 PM »
Okay, I'll give it a shot.
Logged
"Hello, this is Cy Greenbloom, president of Spatula City. I love their spatulas so much... I bought the company."
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
RM2k3 Help--Skill that consumes items?