Jump to content

Sciptig Question


Deleted2746547User

Recommended Posts

I'm working on a project and I could use some help.... I have a script that works for 3 light switches to 3 x markers (a varying number of lights tied to each x marker).. however, whenever i add a 4th or 5th light switch, only he first two will work after that and it "breaks" the rest... every single time. It won't even let you "select" the light switches any more.. unless you delete them and then start a new one. then it works if you play in game. once you go back to geck and create the next one... it break all except he first two again?

 

any ideas?

Link to comment
Share on other sites

I'm working on a project and I could use some help.... I have a script that works for 3 light switches to 3 x markers (a varying number of lights tied to each x marker).. however, whenever i add a 4th or 5th light switch, only he first two will work after that and it "breaks" the rest... every single time. It won't even let you "select" the light switches any more.. unless you delete them and then start a new one. then it works if you play in game. once you go back to geck and create the next one... it break all except he first two again?

 

any ideas?

 

Please show your code for controlling the lights.

Link to comment
Share on other sites

It is part of several scripts designed to enable the use of power & lights by adding fuel to a tank

lights (and the on/off light fixtures etc.) in each building are enabled to the x marker in the cell. the x marker is a linked ref. of an activator switch.

 

 

THANKS

###

 

so, i'll give you each script used to maybe see my error....

 

1. FUEL TANK

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

scn BlackbriarFuelTank

Begin onActivate

If GetQuestRunning BlackbriarPowerBaseQuest

Else

StartQuest BlackbriarPowerBaseQuest

Endif

 

If player.GetItemCount FissionBattery

player.removeItem FissionBattery 1

set BlackbriarPowerBaseQuest.Fuel to BlackbriarPowerBaseQuest.Fuel + 10000

Else

; ShowMessage BlackbriarPowerNoBatteries ; Uncomment when/if you want to display a msg.

Endif

End

 

 

 

2. Power Light Switch

____________________

ScriptName BlackbriarPowerLightScript

 

ref light

 

Begin OnActivate

if BlackbriarPowerBaseQuest.Fuel == 0

return

Endif

if light == 0

set light to GetLinkedRef

endif

 

if light.GetDisabled

light.Enable

else

light.Disable

endif

Activate

End

 

 

3. BasePowerQuest

____________________

scn BlackbriarPowerBaseQuestScript

 

int Fuel ; This is the total fuel units in stock

int FuelRqd ; This is the calculated amount that will be used in a single 5 second period

 

Begin GameMode

If Fuel

Else

return

Endif

 

set FuelRqd to 0

 

;Lghts1 uses 3 unit of Fuel/5sec

If BlackbriarLgts1.GetDisabled

Else

set FuelRqd to FuelRqd + 3

Endif

 

;Lghts2 uses 1 unit of Fuel/5sec

If BlackbriarLgts2.GetDisabled

Else

set FuelRqd to FuelRqd + 1

Endif

 

;Lghts3 uses 2 unit of Fuel/5sec

If BlackbriarLgts3.GetDisabled

Else

set FuelRqd to FuelRqd + 2

Endif

 

;Lghts4 uses 1 unit of Fuel/5sec

If BlackbriarLgts4.GetDisabled

Else

set FuelRqd to FuelRqd + 1

Endif

 

;Lghts5 uses 1 unit of Fuel/5sec

If BlackbriarLgts5.GetDisabled

Else

set FuelRqd to FuelRqd + 1

Endif

 

;Lghts6 uses 1 unit of Fuel/5sec

If BlackbriarLgts6.GetDisabled

Else

set FuelRqd to FuelRqd + 1

Endif

 

;Subtract the fuel used

set Fuel to Fuel - FuelRqd

 

;Turn off all power users when Fuel runs out.

If Fuel < 1

set Fuel to 0

BlackbriarLgts1.Disable

BlackbriarLgts2.Disable

BlackbriarLgts3.Disable

BlackbriarLgts4.Disable

BlackbriarLgts5.Disable

BlackbriarLgts6.Disable

Endif

 

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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