Main Menu
  • Welcome to The RPG Maker Resource Kit.

Question about Variables...

Started by Miles Castea, October 25, 2007, 03:09:54 AM

0 Members and 1 Guest are viewing this topic.

Miles Castea

I created a NPC who is a salesman who sells items for half of the buy price, except the catch, he appears in the beginning town, 1/7 chance. At the beginning, their just items like Potions, Ethers, and Antidotes..etc...is there way I can regulate the type of items he sells depending on the Player's level/progress?; Using Variables?
Current Project:
Altaria: Deus ex Machina (in progress)

Leventhan

Please.......
Read more tutorials?

Be kind, everyone you meet is fighting a hard battle.

Miles Castea

Current Project:
Altaria: Deus ex Machina (in progress)

djkdjl

Of course you can,,that's what CONDITIONAL BRANCH is for.
"If u'r about to die,,then think of how good ur life has treated u up to this point.  On the
other hand,,if life hasn't treated u good up to this point,,then take joy in the fact that
it's not going to bother u for much longer."

Miles Castea

Quote from: djkdjl on October 25, 2007, 04:15:19 AM
Of course you can,,that's what CONDITIONAL BRANCH is for.
What I meant to him was that...
I looked on google, and here for Variable tuts, all of them never explained how to use the Hero's X(Level, EXP, HP, etc...) sub-function, or any uses for it.
Current Project:
Altaria: Deus ex Machina (in progress)

djkdjl

I assume you are using rpg maker xp.

1) Page 1 command: CONTROL VARIABLES

name the variable #001: HERO level [name can be different,,variable # can be different]
Set it to: ACTOR, select your main hero, then LEVEL

2) Page 1 command: CONDITIONAL BRANCH

Variabe: #001 HERO level
              greater than or equal to
Constant: 40 [checkmark the set handling when conditions do not apply

Call SHOP [add items for level 40 hero]

3) in the ELSE section

Repeat step 2, except make the Constant: 30 [or 20, or 10, or 1]

4) Repeat step 3


I don't want to post the full tutorial with pictures for this.
"If u'r about to die,,then think of how good ur life has treated u up to this point.  On the
other hand,,if life hasn't treated u good up to this point,,then take joy in the fact that
it's not going to bother u for much longer."

Miles Castea

Thanks.
For constant, can I use random numbers instead? Like 1-10, for deciding level range.
Current Project:
Altaria: Deus ex Machina (in progress)

djkdjl

You can't really set range that way.  If you follow the tutorial,,what happens is this:

IF 40 <= hero_level <=99, then CALL SHOP 1 [Range: 40-99]
ELSE
IF 30<= hero_level <=40, then CALL SHOP 2 [Range: 30-40]
ELSE
IF 20<= hero_level <= 30, then CALL SHOP 3 [Range: 20-30]

etc....

Of course by writing down different constants you create a different range.
"If u'r about to die,,then think of how good ur life has treated u up to this point.  On the
other hand,,if life hasn't treated u good up to this point,,then take joy in the fact that
it's not going to bother u for much longer."