Jump to content

Need a hand finishing a script


Recommended Posts

Would one of you fine folks mind taking a look a this script for me, on compile it's giving errors on the ints in the ifs & a none error on the quest.stop(). I'm pretty new to scripting so pretty sure I missed something basic.

 

Pastebin - source

Pastebin - errors

Edited by raulfin
Link to comment
Share on other sites

You have used GetRandomPercent. This is a condition function not a papyrus function.

 

If you want to obtain a random percentage, you'll need to do something like the following (not tested)

 

Float RandomPercent = Utility.RandomFloat(0.0,1.0)

Int RandomPercentInt = (RandomPercent * 100) as int

 

I believe if you resolve this misuse of a condition function, the rest of your errors should go away.

Link to comment
Share on other sites

That cleared up a lot and showed up a few typos and such, now it's just giving these 2 errors;

this error for lines 24-64
C:\Program Files (x86)\Steam\steamapps\common\Skyrim\Data\scripts\Source\DIE_ASIS.psc(27,5): type mismatch while assigning to a int (cast missing or types unrelated)
and these on the quest.stop()
C:\Program Files (x86)\Steam\steamapps\common\Skyrim\Data\scripts\Source\DIE_ASIS.psc(329,1): variable RaulDIELevelUpQuest is undefined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim\Data\scripts\Source\DIE_ASIS.psc(329,21): none is not a known user-defined type
Helps to have actually defined the quest... :)
Edited by raulfin
Link to comment
Share on other sites

I just posted the updated script and errors to the same links. I didn't change the storing variables section, just pretty much everything below it.

Edited by raulfin
Link to comment
Share on other sites

Thank you very much! :dance:


Batch compile of 1 files finished. 1 succeeded, 0 failed.


Can finally start on some beta testing to see if it actually does what i want it to!

Edited by raulfin
Link to comment
Share on other sites

Aaaaaaaaaand it doesn't work. I think it may be in how I'm trying to change the value of the global;

int sw3 = ASISSpawnWeight3.GetValue() As Int

if (sw3 != 0) && (swu != 0) && (random <= swc)
ASISSpawnWeight3.setvalue(sw3+swu)
Endif

if (sw0 > 0) && (HM != 0) && (sw6 || sw7 || sw8 || sw9 > 0) && (random <= roc)
ASISSpawnWeight0.setvalue(sw0-(swu*2)) 
EndIf

where swu is a stored player set variable. All the globals are set as floats.

or it could be the random itself;

int random = Utility.RandomInt(0, 100)

I have also tried doing;

int random = Utility.RandomInt(0, 1)
Int Ran = (random * 100) as int

if (sw3 != 0) && (swu != 0) && (ran <= swc)
	ASISSpawnWeight3.setvalue(sw3+swu)
Endif
Edited by raulfin
Link to comment
Share on other sites

  • Recently Browsing   0 members

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