The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: SirMagus on October 03, 2007, 02:30:40 PM

Title: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 03, 2007, 02:30:40 PM
So here's the thing, I'm making a game with RMXP, where i need to make the weapons and armor and stuff require a level of the user. So that a level 4 can't use a level 5 weapon. And also that if the chars strength is 25 he can't use a weapon that requires 26 Strength.

I don't know if there's a way by making events or anything, but script would be much easier,,,, kinda..

Maybe a little hard? ::)
but if you guys could help me with that, that would be terrific! ;D
Title: Re: Level and attribute Requirements
Post by: tSwitch on October 05, 2007, 06:27:29 PM
first off, this should be in requests
and you should have the correct tags
(falcon's gna bitch slap you for that one :P)

anyways, I can think of one way that I would do it
I'll see what I can do
no guarantees
Title: Re: Level and attribute Requirements
Post by: SirMagus on October 05, 2007, 10:44:38 PM
thnx dude, I appreciate it  ;D
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: Zeriab on October 06, 2007, 02:22:29 PM
*moves*

@NAMKCOR: Do you leave the request open for other scripters to take?
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: SirMagus on October 06, 2007, 03:47:29 PM
what do you mean? so if someone makes the script it will be available for all? if you meant that, then yes. Why not? =P
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: Zeriab on October 06, 2007, 04:58:53 PM
Oh no.
It was whether NAMKCOR will do the request or not. It's just so multiple scripters don't do the same thing.
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: Kokowam on October 06, 2007, 05:01:14 PM
Hmmm.... Just an idea but this would be done with arrays, right? And just comparing the actor's level to the level set in the array? :P
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: djkdjl on October 06, 2007, 07:28:52 PM
Yes,,please,,someone make this script

It's gonna be very useful
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: tSwitch on October 06, 2007, 11:25:47 PM
yeah I'll take care of it
it'll be a lot of array work, but I'll do it
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 12:01:03 AM
Thnx Alot, NAMKCOR! You're a real pal!  ;D
Title: Re: [AVAILABLE] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 12:07:23 AM
np
I might just use it myself in a game

just change the tag from AVAILABLE to RESERVED k?
Title: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 12:13:55 AM
sure thing ^^

*clicks and writes*

done =P
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 02:23:24 AM
quick question
this will delay the script slightly, but would you like me to redesign the equip menu as well?
so that when you select a weapon/armor it'll show the stats and stuff as well as required info
(I only ask because it's possible to put that info in the description etc...)

edit: I'm making a custom equip menu but am going to provide it seperately so you aren't required to use it.
the script is simpler than I thought and should be done by the end of the day

I hope you don't mind filling in arrays, cuz that's the only way I could think of doing this
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 07:49:27 PM
You mean that you will make a custom window for weapon/armor creation menu?
in that case, that would be AWESOME. things would get much better
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 08:27:16 PM
not for weapon/armor creation
I mean a custom Scene_Equip
the script itself is done, but I'm still working on a custom Scene_Equip that lets the player see the weapons' requirements
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 08:37:37 PM
oh yeaaaah! of course.  Cool! I don't know how you do it, but it's awesome  ;D it's... Funky  :blizj:
I like the idea.
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 09:25:53 PM
I gotta come up with a decent design for the Equip menu, so the script may be delayed till tomorrow or so

's that ok?
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 10:25:17 PM
Sure, but will there be a function to load your own background display in the equip menu by putting a picture file somewhere?
I mean if you made a function that loads a custom picture file in the background by making the name of the file for example "eq_back" or something? if you understand what I'm talking about =P
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 10:45:39 PM
do you mean a windowskin or replacing the background behind the windowskin
cuz the menu's probably gna take up the whole screen
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 10:53:18 PM
You're making it custom, right? so if you could create a way to make us load our own pictures to replace you custom look if needed.
You don't have to, but it would improve. I should be happy for what i get =P
I really appreciate your work =)
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 07, 2007, 11:16:50 PM
you can't load pictures to replace the way the windows are going to be arranged
the most you could do was change the windowskin
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 07, 2007, 11:44:13 PM
Oh, ok  :-\
oh well, then it'll do without  :lol:
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 10, 2007, 11:12:31 PM
Hey, what's happening, haven't heard from you in days. lol
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 11, 2007, 12:34:59 AM
sorry, I got sidetracked by projects and finals :tpg:

fear not, it is on the way
sorry for the huge delay
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 12, 2007, 03:45:13 AM
Nothing to worry about =P
If i was to do what you do, i would use years XD
Keep up the good work!  :lol:
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 12, 2007, 03:32:04 PM
COMPLETE!

http://rmrk.net/index.php/topic,21554.0.html
Title: Re: [RESERVED] Level and attribute Requirements
Post by: SirMagus on October 12, 2007, 04:16:07 PM
Awesome =D now I'll test it out.
But do i have to edit a part of the script for every weapon i set a requirement for?
Title: Re: [RESERVED] Level and attribute Requirements
Post by: tSwitch on October 12, 2007, 04:59:24 PM
you just need to add the requirements to the arrays
the instructions are included

change the tags btw
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 12, 2007, 11:20:59 PM
I'm a noob at this.
*changes*
Like this?
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: tSwitch on October 12, 2007, 11:29:18 PM
yep
so, working out for ya?
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 13, 2007, 01:55:59 AM
arh...
problems.. should i insert something where is says "nil" ?
If so, what should i insert?
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: tSwitch on October 13, 2007, 02:01:38 AM
just insert stuff into the arrays, like the instructions say
see the line that says

Code: [Select]
#===============================================
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
#===============================================

you don't need to do ANYTHING beyond that line
just imput the values you want into the arrays above that line
(as per the instructions)
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: djkdjl on October 13, 2007, 02:10:24 AM
SirMagus,,follow this step by step...

1) Add the two scripts that NAMKCOR made,,add them above Main.

Name the first script you added: ERSv1.0
Name the second script you added: Scene_Equip

2) Test play your game, and go to the EQUIP screen.  You MIGHT get an error at this point.  If that happens then,,find lines (8-9 I think) in Scene_Equip script [which should be just above Main]and modify those lines
from:
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
to:
    self.contents.font.name = "Arial"
    self.contents.font.size = 24

3) To set the requirements,,you have to modify the ERSv1.0

 example:       @weapon_level_req[0, 3, 10]
 means that:    weapon ID# 1 has no (or 0) level requirement, weapon ID# 2 has a requirement of level 3,,and weapon ID#3 has a requirement of level 10
 
*Note* The array goes in order @weapon_level_req[LvReq_of_weaponID#1, LvReq_of_weaponID#2 ,LvReq_of_weaponID#3, LvReq_of_weaponID#4, LvReq_of_weaponID#5...]

So you modify (line 66 I think) of the ERSv1.0 script to what you want/need
Further lines set other requirements such as strength and dexterity required.

Hope that helps....
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: tSwitch on October 13, 2007, 02:12:48 AM
SirMagus,,follow this step by step...

1) Add the two scripts that NAMKCOR made,,add them above Main.

Name the first script you added: ERSv1.0
Name the second script you added: Scene_Equip

2) Test play your game, and go to the EQUIP screen.  You MIGHT get an error at this point.  If that happens then,,find lines (8-9 I think) in Scene_Equip script [which should be just above Main]and modify those lines
from:
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
to:
    self.contents.font.name = "Arial"
    self.contents.font.size = 24


3) To set the requirements,,you have to modify the ERSv1.0

 example:       @weapon_level_req[0, 3, 10]
 means that:    weapon ID# 1 has no (or 0) level requirement, weapon ID# 2 has a requirement of level 3,,and weapon ID#3 has a requirement of level 10
 
*Note* The array goes in order @weapon_level_req[LvReq_of_weaponID#1, LvReq_of_weaponID#2 ,LvReq_of_weaponID#3, LvReq_of_weaponID#4, LvReq_of_weaponID#5...]

So you modify (line 64 I think) of the ERSv1.0 script to what you want/need
Further lines set other requirements such as strength and dexterity required.

Hope that helps....

yeah, I always get that error with new scripts
I use Blizzard's Tons of Addons - Shaded Text addon to solve that problem all the time

also, make sure Scene_Equip goes below ERSv1.00

otherwise, you've got it right
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 13, 2007, 02:27:37 AM
Thnx alot!
Just what i needed!
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: djkdjl on October 13, 2007, 02:39:15 AM
IF you are still getting an error that says something about,,nil,,or some nonsense like that,,then that is because your array is let's say only 5 items long,,

but the weapon you are trying to equip is like number 23 in your database weapons list.

So obviously your array would have to be AT LEAST 23 items long.
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 13, 2007, 03:10:51 AM
but i'm gonna have LOADS of weapons and armors... and i mean LOADS..
For now i have 21 Blades, and then i'll have to make swords, bows and so on.
LOL can the script handle it? XD

And also,, NAMKCOR, on the topic you posted with the script..
you wrote the requester was SirMagnus XD
Many people make that Mistake XD
Why? =P   lol, plz edit it to   SirMagus
Thnx
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: djkdjl on October 13, 2007, 03:14:25 AM
Yup,,it should.  The works awesome.


LoL imagine putting requirements for some 999 weapons,,LoL!  That would be one loooooong array.
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: tSwitch on October 13, 2007, 04:43:44 AM
IF you are still getting an error that says something about,,nil,,or some nonsense like that,,then that is because your array is let's say only 5 items long,,

but the weapon you are trying to equip is like number 23 in your database weapons list.

So obviously your array would have to be AT LEAST 23 items long.

the nil error is because if nil was a value in the array when you went to equip an item
it would crash
so I put that message in to let the maker know "hey, you need to fix up your arrays"

but i'm gonna have LOADS of weapons and armors... and i mean LOADS..
For now i have 21 Blades, and then i'll have to make swords, bows and so on.
LOL can the script handle it? XD

And also,, NAMKCOR, on the topic you posted with the script..
you wrote the requester was SirMagnus XD
Many people make that Mistake XD
Why? =P   lol, plz edit it to   SirMagus
Thnx

yes, the script can handle it, you can use as many elements in the arrays as you need, you just need to keep adding commas and values inside the brackets (no comma after the last value)

yeah, they will be long arrays, I tried to find an easier, neater, way to get the job done
but it had to be done with arrays if you wanted every last weapon/armor to be included

and yeah, I noticed that earlier and fixed it up right away
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: SirMagus on October 13, 2007, 05:09:52 AM
Thnx, and awesome service here =D
Title: Re: [RESOLVED] Level and attribute Requirements
Post by: tSwitch on October 13, 2007, 09:49:54 AM
no problems, 's what I do