Jump to content

Small script question, should be easy for you guys


hunterrock

Recommended Posts

Hi,

 

I am trying to change ASIS to only spawn added spawns in interiors.

 

The kind people on the ASIS page have helped me out a lot but there are a few kinks left.

 

This is the section of the script. The part in bold and underlined is what I have been told to add.

 

Int Function getSpawnNum()
If Not IsInInterior()
Return 0
EndIf
;Grab all the values from the globals.
multiplier = ASISSpawnMult.GetValue()
Bool reducedInteriorSpawns = ASISUseInteriorSpawns.GetValue() As Bool
If reducedInteriorSpawns == True && IsInInterior()
interiorSpawns = ASISIntSpawnsReduceFactor.GetValue()
Else
interiorSpawns = 1
EndIf
spawn0weight = (ASISSpawnWeight0.GetValue() )
spawn1weight = (ASISSpawnWeight1.GetValue() * multiplier / interiorSpawns) + spawn0weight
spawn2weight = (ASISSpawnWeight2.GetValue() * multiplier / interiorSpawns) + spawn1weight
spawn3weight = (ASISSpawnWeight3.GetValue() * multiplier / interiorSpawns) + spawn2weight
spawn4weight = (ASISSpawnWeight4.GetValue() * multiplier / interiorSpawns) + spawn3weight
spawn5weight = (ASISSpawnWeight5.GetValue() * multiplier / interiorSpawns) + spawn4weight
spawn6weight = (ASISSpawnWeight6.GetValue() * multiplier / interiorSpawns) + spawn5weight
spawn7weight = (ASISSpawnWeight7.GetValue() * multiplier / interiorSpawns) + spawn6weight
spawn8weight = (ASISSpawnWeight8.GetValue() * multiplier / interiorSpawns) + spawn7weight
spawn9weight = (ASISSpawnWeight9.GetValue() * multiplier / interiorSpawns) + spawn8weight
;Debug.MessageBox("Spawn9Weight: " + spawn9weight as String)
;Roll the random numbers.
Float xSize = 0
xSize = Utility.RandomFloat(1, spawn9weight)
If xSize <= spawn0weight
Return 0
ElseIf xSize <= spawn1weight
Return 1
ElseIf xSize <= spawn2weight
Return 2
ElseIf xSize <= spawn3weight
Return 3
ElseIf xSize <= spawn4weight
Return 4
ElseIf xSize <= spawn5weight
Return 5
ElseIf xSize <= spawn6weight
Return 6
ElseIf xSize <= spawn7weight
Return 7
ElseIf xSize <= spawn8weight
Return 8
ElseIf xSize <= spawn9weight
Return 9
EndIf
Return 0
EndFunction
So I have done this, and set up the scriptcompiler.bat to point to my directory. No problem there.
Go to compile the script and I get the error:
No viable alternative at input 'Not'
This is from line 137 which is - If Not IsInInterior()
Now I am guessing I need an else if somewhere, but I have no idea.
Please could someone tell me what to include in the script to let it work/compile?
I am a very novice modder and this is my first venture into scripting but I am enjoying it and will be extremely grateful for any assistance.
Many Thanks
Link to comment
Share on other sites

  • Recently Browsing   0 members

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