Chaos Project

Game Development => Tutorials => Tutorial Requests => Topic started by: Rolandojis on April 09, 2012, 03:05:37 pm

Title: [XP] How to put Variable as Prize???
Post by: Rolandojis on April 09, 2012, 03:05:37 pm
I want like a monster that instead of dropping and item it drops a variable when killed

Example: After defeating Monster1 you get +1 of variable2

How can I do that???
Title: Re: [XP] How to put Variable as Prize???
Post by: Calintz on April 09, 2012, 05:42:48 pm
in other words, you want to increase a specified variable by one for every time you defeat a specific enemy?
Title: Re: [XP] How to put Variable as Prize???
Post by: Rolandojis on April 09, 2012, 07:29:31 pm
mm i dunno if i specified myself, in my game monsters drop elements like fire or water

so i want it to be able to specify a monsters drop in variable

Example:
Variable2=Fire
Monster1=+1Fire drop
Monster2=+2Fire drop

Instead of having the "teasure"(database name) as an item, have a teasure of variable
Title: Re: [XP] How to put Variable as Prize???
Post by: Calintz on April 09, 2012, 07:51:58 pm
so you call the item's dropped by enemies "elements." these elements are actually items in your database though, right? you have an item called "fire," and another item called "water," and so forth?
Title: Re: [XP] How to put Variable as Prize???
Post by: Rolandojis on April 09, 2012, 08:56:45 pm
No they aren't items, I set them up as variables
variable 10 is Plant
variable 11 is Water
etc...

I want monsters to drop this "elements" each monster drops diferent amounts of elements that add up to the variable
so after killin 2 monsters that drop 3 water each, then variable 11's amount would be 6
Title: Re: [XP] How to put Variable as Prize???
Post by: Calintz on April 09, 2012, 09:02:00 pm
i don't understand why this is valuable? why would you want to set a variable that way? i don't understand why you wouldn't just make items that reflect the element you want the enemies to drop? anyway, i think that requires a script mod, and i wouldn't be able to do that for you. what battle system are you using? i don't think i can help you. sorry.
Title: Re: [XP] How to put Variable as Prize???
Post by: Rolandojis on April 09, 2012, 09:20:59 pm
well thnx anyways. umm the normal battle system

and I use this because the elements are used to create things or buy things.
Example:
You go to a specific place with 2 Plant and 1 wood and create Tree
You go to FlamingCrafts with 1 fire and 2 wood and create torch

I would do this with items but in conditional branchs only appears if you have a type of item in possesion, not a quantity of an item
Title: Re: [XP] How to put Variable as Prize???
Post by: KK20 on April 09, 2012, 09:51:41 pm
Quote from: Rolandojis on April 09, 2012, 09:20:59 pm
I would do this with items but in conditional branchs only appears if you have a type of item in possesion, not a quantity of an item
Is there any reason why you can't just set a temporary variable to equal the quantity of the element? You can do that you know.
"Control Variables" => "Set" => "Item [Dropdown list] In Inventory"
Title: Re: [XP] How to put Variable as Prize???
Post by: Calintz on April 10, 2012, 12:49:34 am
that would probably work. if you create an item for each element, and use a common event to constantly set the amount of each element in the inventory (use a switch to activate it at the beginning of the game) this would work. then the conditional branch could be used to check the quantity of each element in the inventory.