Use item and get another

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
Hey guys.


Mabye a easy thing, but i want to create a water bottle. And if you use it, than the item removes, but i want to get an empty bottle at the same moment.


I know, i can do it with common events, but i have many items where this will be happend and i dont want to create a few common events for such a small feature.


thanks for help, greez BD
 

frzhrt834

Infamous Warrior of Storms
Veteran
Joined
Aug 4, 2015
Messages
139
Reaction score
14
First Language
French
Primarily Uses
RMMV
I'm not sure you can do this without common event. Maybe a plugin could help you, but as it can be done with common events, there may not be one to do that. Why you don't want to use common events?
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
I'm not sure you can do this without common event. Maybe a plugin could help you, but as it can be done with common events, there may not be one to do that. Why you don't want to use common events?
Because there must be more than one common event. I want to create many items with this functions. I have tried to link more than one item to a single common event and trigger a variable with the formular field. But i can not figure out the right command. I tried: $gameVariables.setValue(457, 1) for my books.

In the common event a cond. branch an variable = 1 bla bla bla end


than variable = 2 bla bla end


etc.

But everytime the console opens and such things xD It dont crashs because i have yanflys debugger. Without it, it will crashs instandly.
 
Last edited by a moderator:

Dr. Delibird

Also known as HRforges
Veteran
Joined
May 16, 2014
Messages
283
Reaction score
176
First Language
English
Primarily Uses
RMMZ
There is no way to do it without using multiple common events. If you are worried about using too many common events don't  be, you can have a maximum of 9999 common events and I do not know anybody who has come close to that ammount. If you are more worried about all the work required I understand but tbh copy/paste and then a tiny edit will save you a lot of time.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If it crashes, show us what the console says so we can help you figure it out.


Actually, you could do it in the damage formula.  If your damage formula is 10 (to restore 10 HP), and your empty bottle item is 18, just change the damage formula (on the full bottle) to this:

Code:
$gameParty.gainItem($dataItems[18], 1); 10


So it gives the party one of item 18 (the empty water bottle), and then gives 10 HP.  The actual damage value should always come last.
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
There is no way to do it without using multiple common events. If you are worried about using too many common events don't  be, you can have a maximum of 9999 common events and I do not know anybody who has come close to that ammount. If you are more worried about all the work required I understand but tbh copy/paste and then a tiny edit will save you a lot of time.
I only can create 1000 common events and i use already the half.

 

If it crashes, show us what the console says so we can help you figure it out.


Actually, you could do it in the damage formula.  If your damage formula is 10 (to restore 10 HP), and your empty bottle item is 18, just change the damage formula (on the full bottle) to this:

Code:
$gameParty.gainItem($dataItems[18], 1); 10


So it gives the party one of item 18 (the empty water bottle), and then gives 10 HP.  The actual damage value should always come last.
Yeah!


This is the way i searched about! Works pretty! And this solve my other problem, too. I dont write a anything after the $gameVariables.setValue(457, 1). This have to be:
$gameVariables.setValue(457, 1); 0


And now it works.


Thanks at all BD
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yep, as long as the syntax & arguments are right, and the damage calculation is at the end, you should be good :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top