The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Bash on April 15, 2009, 08:42:32 PM

Title: More help plz I noob :(
Post by: Bash on April 15, 2009, 08:42:32 PM
Bsically I want it to check to see if the player has enough gold and slime gels in thier inventory.
The one I'm using right now seems very bulky and a bit difficult to make changes.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimageflock.com%2Fimg%2F1239828111.png&hash=03128efae45d8f8f6e2994d9b708a0ff48014b80)
Title: Re: Easier way to do this?
Post by: vgvgf on April 15, 2009, 09:01:08 PM
Scripts are almost always the quickest way. You can add this code into a conditional branch:
($game_party.gold >= 10) and ($game.party.item_number($data_items["slime item id"]) >= 5)
($game_party.gold >= 10)
This will check if the party has 10 or more gold. Change the 10 with the amount of gold you want.

($game.party.item_number($data_items["slime item id"]) >= 5)
Here you have to change the "slime item id" text with the slime gel item ID from the database. This will check if you have 5 or more slime gels in your inventory. Change the 5 with the amount you want.
Title: Re: Easier way to do this?
Post by: Bash on April 15, 2009, 09:03:49 PM
Thanks, now I have this error when I select make 'Slime toppers' option.
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimageflock.com%2Fimg%2F1239829733.png&hash=71d7c48cc3a632356bffe064606c647152b843ad)


Though I fixed it but came up anyway. Im gonna try removing the lines for the quest script and see if that works.
Edie: Nope. not problem
Title: Re: Easier way to do this?
Post by: vgvgf on April 15, 2009, 09:16:56 PM
First, sorry, I make a typo in the code, a "." insteand of a "_", here is corrected:
($game_party.gold >= 10) and ($game_party.item_number($data_items["slime item id"]) >= 5)

Also I have tested it, and works:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg89.imageshack.us%2Fimg89%2F7953%2Fdibujohod.png&hash=746b3a40261ff62d6f4241682bca04dacfc2b8c5)

Have you changed "slime item id" to the item id?
Title: Re: Easier way to do this?
Post by: Bash on April 15, 2009, 09:19:55 PM
Are there any tutorials on how to make and use little scriptlets like that? It would help me a lot. And thanks  :D
Title: Re: Easier way to do this?
Post by: modern algebra on April 15, 2009, 10:08:04 PM
Well, for a lot of that kind of thing you just need to know the syntax and the code, so it'd be an awkward tutorial to write since it would amost require teaching methods. The best thing I can say is learn syntax, so things ike >= is the same as greater than or equal to, and == is checking if equal to, and then search through the scipts for the methods you want.
Title: Re: Easier way to do this?
Post by: vgvgf on April 15, 2009, 11:38:33 PM
I have never seen a tutorial for event scripting, but it is a good idea. I will make a tutorial for that.
Title: Re: Easier way to do this?
Post by: Bash on April 16, 2009, 01:10:56 AM
I'm not oblivious to coding concepts because I do actionscript, I just meant how to do small stuff so I can make things lighter and easier. eg: The gold and item checking method previously posted.
Title: Re: Easier way to do this?
Post by: Bash on April 17, 2009, 06:25:24 PM
Is this right? I keep getting a syntax error.(This was put into a conditional branch)
($game_party.item_number($data_items[007]) >= 3) and ($game_party.item_number($data_items[008]) >= 17)

Title: Re: Syntax Error
Post by: modern algebra on April 17, 2009, 06:39:20 PM
take out the zeroes. $data_items[7], not $data_items[007]

Also, you might as well do this the way you had originally. The only silly thing was that you added a condition to check if item was in inventory, when you could've just grabbed the variable way and then checked that and thus reduced the number of conditional branches. Using a script here is not really that necessary :/

But the script way is fine too, it's just not much different.
Title: Re: More help plz I noob :(
Post by: Bash on April 18, 2009, 09:07:03 PM
Basically I want the the player to input a number, then it checks if the raw meat they have is greater than the number inputted. Then it multiplies the inputted number by 2(the amount of gold need per piece). Lastly it checks to see if you have enough gold, and the subtracts gold and meat accordingly. However it does not work the way I imagined.
Heres what I have, it does not work :(
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimageflock.com%2Fimg%2F1240088505.png&hash=bc9e21dd724d4c76c85b9abd19a3a3839b15e9a4)


My error:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimageflock.com%2Fimg%2F1240088762.png&hash=d1b9001b671592268c09d80b6f48ef5bada19997)


I just cant seem to figure out why it does not work. Sorry for having so many errors/questions I noob. :(
Title: Re: More help plz I noob :(
Post by: vgvgf on April 19, 2009, 07:34:05 PM
You are not using scripts in that event, so it shouldn't give you that error. Maybe you have a conflicting script installed, do you have added some scripts?
However, the event should work well. Maybe you can improve it, removing the use of the variable "43:Batch V3", and just using the V1 for changing the amount of items.
Title: Re: More help plz I noob :(
Post by: Bash on April 19, 2009, 07:59:20 PM
I am using:
Recover mp/hp/sates after level up
ATS 2.0
Paragraph Formatter
Quest Journel
Title: Re: More help plz I noob :(
Post by: modern algebra on April 19, 2009, 08:09:00 PM
Nah, you just haven't grabbed the variable fix. RMVX is packaged with a couple errors regarding variable manipulation in Game_Interpreter. See: http://rmrk.net/index.php/topic,25243.0.html
Title: Re: More help plz I noob :(
Post by: vgvgf on April 19, 2009, 08:25:14 PM
Quote from: Modern Algebra on April 19, 2009, 08:09:00 PM
Nah, you just haven't grabbed the variable fix. RMVX is packaged with a couple errors regarding variable manipulation in Game_Interpreter. See: http://rmrk.net/index.php/topic,25243.0.html
Oh, I didn't know that RMVX had too many errors, hehe. Enterbrain should check things carrefuly.
Title: Re: More help plz I noob :(
Post by: Bash on April 19, 2009, 10:43:14 PM
It works now thx.