Jump to content

Randomness


AnarhIztok2511

Recommended Posts

Well, I got an idea and want to write my first scenario - don't worry, I tried to make a big one once, and I learned my lesson - so it will be a short one.

I just stumbled upon one detail I cannot solve.

I want to make a certain event or a special that would occur if let say, hypothetically, your dexterity is high enough.

But to avoid setting an exact amount, I wanted to make it more likely to happen if your dex is higher.

Like for example:

(dex x 5)% of happening or something

So that even if you hadn't 20 dex it could happen - you would just need to try more times, like rolling dice, if you get what I mean ...

 

Thanks in advance

 

------------------------------------

 

Look! It's my one hundredth post!

A time for celebration!

...

Or is it?

Link to comment
Share on other sites

Use get_ran(x,y,z)

X- number of dice to be rolled. Probably just set this to 1.

y- smallest number each die can come up.

z - largest number each die can come up.

 

So put something like if(get_highest_skill(1) >= get_ran(1,1,20)). In this case, it is possible for it to occur even if your highest dexterity is only 1, but its only a 5% chance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...