Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> (VX) Something wrong with my Raw Materials system., Just can't get the event to work.
Quackadoos
post Jun 28 2011, 11:53 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 63
Type: Writer
RM Skill: Intermediate
Rev Points: 10




Hi.

I recently started making a game called When Demons Run and I have been trying to make a sort of loot system similar to that in Final Fantasy XII. Basically, certain monsters drop Raw Materials and when the player has a certain number they are given the option to use the materials to create special armours and such.

Now I've tried to set up the system using the Fetch Quest tutorial found here, however I can't get the system to work. Using the tutorial mentioned above I hashed together the following event, but to be honest I'm still a novice at this and I've got no idea how to use the Variables so the problem could lie therein:

CODE
@>Loop
  @>Conditional Branch: [Bat Hide] in Inventory
   @>Control Variables: [0002:Bat Hides] = 1
   @>Change Items: [Bat Hide], -1
   @>
  : Else
   @>Conditional Branch: Variable [0002:Bat Hides] >= 2
   @>Text: -,-, Normal, Top
   :     : You now have enough raw materials to make a special armour
   :     : Would you like to use your Bat Hides to make a special
   :     : armour?
   @>Show Choices: Yes
   : When [Yes]
     @> Change Items: [Bat Hide], -2
     @> Change Armour: [Bat Robe], +1
     @>Text: -,-, Normal, Top
     :     : You sew the Bat Hides together and obtain a Bat Robe.
     @>Control Switches: [0011:Fashion 101] = OFF
     @>
   : Branch End
   @>
: Else
   @>Change Items: [Bat Hide], +1
   @>Control Variables: [0002:Bat Hides] = 1
   @>
: Branch End
@>
: Repeat Above
@>


This event is started by a battling event which works fine, but when the required number of Raw Materials is obtained nothing happens and the player is left with some essentially useless items.
If anyone has any ideas as to where I've gone wrong please let me know.
Thankyou happy.gif


__________________________
Current Projects:

Reapers
I support:










Go to the top of the page
 
+Quote Post
   
TheBen
post Jun 28 2011, 05:43 PM
Post #2


Intolerable Noob
Group Icon

Group: Revolutionary
Posts: 344
Type: Developer
RM Skill: Beginner




Your problem is that you set the variable "bat hides" instead of adding or subtracting it, as the case may be. At the first loop, you're setting "bat hides" to 1 when you want to add 1 to it...
CODE
@>Loop
  @>Conditional Branch: [Bat Hide] in Inventory
   @>Control Variables: [0002:Bat Hides] = 1 #You want to add 1 to "Bat Hides", not set it to 1
   @>Change Items: [Bat Hide], -1
   @>


And I think you might want to subtract 1 from "Bat Hides" near the end.
CODE
   @>
: Else
   @>Change Items: [Bat Hide], +1
   @>Control Variables: [0002:Bat Hides] = 1 #Maybe you meant "subtract 1"
   @>
: Branch End
@>


If this fix is implemented, then you'll want to set "Bat Hides" to 0 after the player makes his bat coat.

I hope this works. Don't worry about the errors - everyone makes these in their early years of game design. You'll get better at it.

PS Forgive me for any errors. This is largely untested work, and I'm still in my early years, too.

This post has been edited by TheBen: Jun 28 2011, 05:44 PM


__________________________
QUOTE
Great people talk about IDEAS
Average people talk about THINGS
Small people talk about OTHER PEOPLE

- A plaque on a BBQ restaurant in VA
Go to the top of the page
 
+Quote Post
   
Alt_Jack
post Jun 28 2011, 07:52 PM
Post #3


Level 19
Group Icon

Group: Revolutionary
Posts: 377
Type: Event Designer
RM Skill: Skilled
Rev Points: 40




Dear god, what the ----- is that?! ohmy.gif
Let me first start off by saying this is an explanation of why this is wrong, rather than a verbal beat-down. So, let's walk you through this, based on my understanding of this mess:
QUOTE (Quackadoos @ Jun 28 2011, 11:53 AM) *
QUOTE
@>Loop (these are dangerous. Don't use them)
@>Conditional Branch: [Bat Hide] in Inventory (is there at least one bat hide in your inventory? Yes? Well.... )
@>Control Variables: [0002:Bat Hides] = 1 (set variable #002 to 1. Not add, subtract, or any other operation; just change it to 1 from any number you could possibly imagine. Now it's just 1. You'd typically use this to reset a value back to 0, rather than do any kind of math, which VX (as well as myself) is very bad at)
@>Change Items: [Bat Hide], -1 (then subtract one from your inventory for no reason)
@>
: Else
@>Conditional Branch: Variable [0002:Bat Hides] >= 2 (if there's more than 2, which isn't likely since, if I'm reading this right, the system will always loop subtracting a bat hide, if you have one. Actually, it doesn't even apply, since this is the value and doesn't really seem to effect anything. It just checks if the variable is >2, even though the system keeps setting it to 1, as per above )
@>Text: -,-, Normal, Top
: : You now have enough raw materials to make a special armour
: : Would you like to use your Bat Hides to make a special
: : armour? (well, duh)
@>Show Choices: Yes (I'm pretty sure that there's also a "No" option) : When [Yes]
@> Change Items: [Bat Hide], -2 ( you should also subtract it from the variable database, so that the numbers match up)
@> Change Armour: [Bat Robe], +1 (eewwwww! )
@>Text: -,-, Normal, Top
: : You sew the Bat Hides together and obtain a Bat Robe. (does it fit? Just how big are these bats?! )
@>Control Switches: [0011:Fashion 101] = OFF (where did this switch come from? It's not mentioned above, I don't think)
@>
: Branch End
@>
: Else
(this is getting random)
@>Change Items: [Bat Hide], +1
@>Control Variables: [0002:Bat Hides] = 1
@>
: Branch End
@>
: Repeat Above (hopefully not. What a mess... )@>

...and there you have it. I think my brain threw up trying to understand that. pinch.gif Try this instead:
http://www.rpgmakervx.net/index.php?showto...mp;#entry288794
you can also find scripts that call common events from menu commands. The engine I use has a bunch of scripts like this.

This post has been edited by Alt_Jack: Jun 28 2011, 08:00 PM


__________________________

the Alternate Jacks event demo
As well as all of my images in one place, free for use.
Most of my images will be there, since this site takes too long to approve stuff and VX.net has no bulk uploader.
Go to the top of the page
 
+Quote Post
   
Quackadoos
post Jun 29 2011, 03:57 AM
Post #4


Level 5
Group Icon

Group: Member
Posts: 63
Type: Writer
RM Skill: Intermediate
Rev Points: 10




Thanks guys, it's working now. Apologies for the messed up code, I had to start it again so that I could follow it sweat.gif
Turns out it was the variable thing that was messing it up, so thanks for clearing that up for me.


__________________________
Current Projects:

Reapers
I support:










Go to the top of the page
 
+Quote Post
   
lilcooldude69
post Jul 11 2011, 02:04 AM
Post #5


The pro-est eventer u know ;D
Group Icon

Group: Revolutionary
Posts: 297
Type: Event Designer
RM Skill: Masterful




*cough cough*Control Variables: [002] = [Bat Hide] in Inventory*cough cough* scuse me xD... okay im sorry lemme elaborate, you can always set an item in your inventory to a variable then when that variable reaches a certain number like perhaps greater than 2 then you can trigger an event, also jack was right about loops, they are very dangerous, they can somtimes freeze your game if not done right, if you wanna loop, use jumpto labels, its safer S:


__________________________

My Userbars


Rated pg-13 part of signiture
Scientist A: "A single sperm has 37.5MB of DNA information in it. That means a normal ejaculation represents a data transfer of 1,587.5TB."
Scientist B: Too bad ejaculate has terrible packet loss
Scientist C:but the transfer does have a lot of redundancy

Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 11:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker