RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved] Help! Ability Level-Up Event!

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 83
Guildmaster of Graceful Ubiquity [GU]
I want to add an ability series of events which allow a player to search for traps, lockpick things, etc, and everytime a player successfully does one of these actions, that particular ability gains exp and eventually levels up, making it a little bit easier to do it again next time. The abilities are as followed:

Perception (Listening, Searching, etc.)- Can help you find traps or secret doors or what ever
Disabling- Will help you disable traps that you find
Reflex- Will help you dodge traps or save your self in the nick-of-time from falling or something similar
Lockpicking- Self explanitory, open locked doors/chests
Knowledge- Can help you identify things or learn a secret sooner or whatever
(maybe more)

Anyway, the problem i'm having is that when a player should get exp from succesfully undergoing one of these challenges, he doesn't, or maybe he does, but the event i set up wont level up the skill.



So, this is how I set up the first event (lockpicking a locked gate):

@>Control Variables [0020: Random Number] = Random No. (1...3)
@>Conditional Branch: Variable [0020: Random Number] >=2
    @>Text: -,-, Dark, Top
     :        : You failed to pick the lock, the lockpick you were using broke
    @>Change Items: [Lockpick], -1  
    @>Control Variables: [0006:Lockpicking EXP] +=1
    @>
:   Else
    @>Text: -,-, Dark, Top
     :        : You successfully picked the lock!
    @>Control Variables: [0006:Lockpicking EXP] +=3
    @>Control Switches: [0021: S Lock1 1] = ON
    @>
:   Branch End


This event was the 1st page on the locked door. the Random Number variable would be reused for all the events that required a number to be random. the switch, S Lock1 1 was the switch to turn on the second page of this event, which would then open toe door. I made 2 more variables, one called Lockpicking and one called Lockpicking EXP. When the Lockpicking EXP reached a certain number, it would be reduced back down to 0 and the Lockpicking Variable would be increased by 1. The event above was copied and pasted in a conditional branch that made it so the higher your Lockpicking was, the higher the odds of picking the lock was. In any case, what i am having problems with is the event that says when Lockpicking EXP reaches 12, the variable Lockpicking gets +1 and the message "Your Lockpicking ability has increased!" is displayed. That event is below:


@>Conditional Branch: Variable [0006: Lockpicking EXP] == 12
    @>Control Variable: [0005: Lockpicking] += 1
    @>Control Variable: [0006: Lockpicking EXP] = 0
    @>Text: -,-, Dark, Top
     :        : Your Lockpicking ability has increased to 2
    @>

Thats the end of it, nothing past that. For some reason, when i do the lockpicking a bunch of times, to where i should have 12 in the variable Lockpicking EXP, i dont get the level up message, which is really the only way  you'd know that the ability has increased in level. I don't know if the variable Lockpicking EXP is getting that +3, or if the second event is even realiseing that the variable has reached 12. IDK what is the problem because i thought it looked solid. If anyone would be kind enough to read through that mess above and help me with this event that is CRUCIAL(sp) to my game, it would be much appreciated. Thanks in advance
« Last Edit: November 10, 2009, 05:20:25 AM by Tri Edge »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Just to begin, make sure you throw a conditional branch in your events when you make them for lock picking if you ever plan on removing items from your inventory. Always first check if you have any in your inventory. If you don't check and the player doesn't have any, they can pick locks infinitely.

Also, the switch you're using to go to the next page, use Self Switches since each event is independent of other events. Only use switches if it's global (like you need that particular switch to affect other things than this certain door.) It'll save you on the number of switches you end up using.

Also, the problem you're facing is because of: @>Conditional Branch: Variable [0006: Lockpicking EXP] == 12
If you notice, you have it so it only rings true if it equals 12 EXACTLY. It'll be fixed if you change it to >= (Greater than or equal to). The problem occurs where say you have 11 exp, then you successfully pick a lock, well now it equals 14 exp. That's not equal to 12, so the condition is never met and just continues infinitely.

Also, in your text message that displays when a player levels up, change:
"Your Lockpicking ability has increased to 2."
to
"Your Lockpicking ability has increased to \v[5]."

The \v[5] in a text message will display the value of variable 5. It makes that message dynamic so you don't have to create a whole new event for each level. Also, I would set a cap for your lockpicking level. Depending on how long a player plays the game and lockpicks or levels that up, variables go past 99, and I know a lot of games cap their abilities at 99 usually.

This should fix all. :]

**
Rep: +0/-0Level 83
Guildmaster of Graceful Ubiquity [GU]
holy crap, i never thought of that, thanks man. I can't believe i missed that  ;D
appreciate it!