Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: Resistance on July 03, 2007, 10:27:31 PM
-
in rpg maker xp (scripting) how would you make something random like if i wanted to picklock a door how would i make it so there's a chance of failing?
edit: oh wait...is this the right place to put this topic...
-
I believe this is the right place for this.
Use a variable. This was done in 2k3, but IIRC, it can be done in XP, if you're doing this with an event.
Event: Locked Door
>FORK: if Lockpick is held
> Message: It's locked. Pick it?
> Show Choices: Yes, No
> Yes Handler
> Call common event: Pick Locks
> No Handler
>
> Else Handler
> Locked.
>
>End
Common Event: Pick Locks
Call
*put some sounds here and animation of char attempting to pick lock*
Wait: x.x secs.
set v[###] rand. 1-10
Fork: if v[####] is >1
Fork: if V[####] is <5
play sound: pickfail
show message: Failed!
remove item: 1 Lockpick
Fork: if v[####] is >6
playsound:pickOK
Show message: Success!
*then do whatever you need to do here*
Hope that helps.
EDIT: Oh, you wanted it in scripts. Eheh...look around at sites, I'm sure someone made a lockpicking script...
-
hmm something is wrong sometimes it says failed then success
edit: nevermind found a solution oh and thanks for you help!