Jump to content

GetRandonNumber < ActorValue


Recommended Posts

Hi, I'm trying to make a mod that requires this condition on a perk:

 

GetRandonPercent < Luck

 

the problem is that I can only choose a real number (0-100) when performing the "getRandomPercent"

and If I check the "global" box, I've pretty much search for every option there and couldn't find "luck" as a parameter.

 

Is it possible?

If so, how could I do it?

thanks in advance

Edited by TaliRedmint
Link to comment
Share on other sites

Do it in script as follows (assuming you have a refAlias named PlayerREF - if not, use your ref name instead):

 

Int Luck = PlayerREF.GetValue( Game.GetLuckAV() ) as int

Int Random = Utility.RandomInt(1,100)

 

If Random < Luck

...

Endif

 

Have your targeted outcome fall between the if/endif.

 

If this is dialogue conditions...

 

Use GETVALUE with LUCK as the parameter, running on the PLAYER, comparing to a global value as a GREATER than. And then have a global variable declared in your script and do:

 

Int Random = utility.randomint(1,100)

GlobalVariableName.setvalueint(Random)

 

And I say greater than because you cannot make a condition that says GLOBAL VARIABLE is less than LUCK. But you can say, LUCK is GREATER than the GLOBAL VARIABLE.

Edited by joerqc
Link to comment
Share on other sites

  • 3 weeks later...

Forgive my ignorance but you got me lost there. I think what I need is a step by step explanation on how to create a Global that resembles the player's luck.

 

I'm not a programmer, so it would be very appreciated if someone could be didactic.

 

I tried this: right click on the Global tab, and select "new" so I could create my Global (that resembles player's luck)

It opens a window with only a space for a number. Don't laugh but I tried to write there "player.getav luck" surely it didn't accept words. It would solve my problem if it did.

Edited by TaliRedmint
Link to comment
Share on other sites

I'm not a programmer, so it would be very appreciated if someone could be didactic.

 

 

GetValue - GlobalVariable

Member of: GlobalVariable Script

Gets the current value of this global object.

Syntax
float Function GetValue() native
Parameters

None.

Return Value

The current value the global holds.

Examples
; Obtain the current time of day
float timeOfDay = TimeOfDayGlobalProperty.GetValue()

 

 

Where can I even write this?

Edited by TaliRedmint
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...