Deleted2746547User Posted May 18, 2012 Share Posted May 18, 2012 I'm working on a mod but I've run into a little confusion when it comes to Quest Scripting. I'm using Quest "accomplishments" to enable the construction of player buildings, award improvements, etc. but am a bit lost (and yes, I've read the forums). First thing: I need to write a script so an NPC will approach the Player after he exits the Doc's House in Goodsprings. The npc will join the player and give him the first Quest. The primary quest will include: having a series of player "home" improvements/additions (tied to "markers") become enabled as the player completes various stages in the first mission/and after he speaks with specific NPCs. A little advice ? Thanks Link to comment Share on other sites More sharing options...
Deleted2746547User Posted May 21, 2012 Author Share Posted May 21, 2012 One major issue I'm having is with a "power" script. That is, I set up a Quest that handles the "power" for lights, computers, etc. at the base I'm constructing in my mod.Once you provide fission batteries that enables a script that will allow you to turn on various light switches, etc. throughout the base. however, once you run out of batteries (batteries convert to "fuel" in the script) the lights turn off and you have to provide more. etc. Anyway, I had it working correctly before but now, I can't get it working. not sure if its b/c of a change in link ref or enable ref or WHAT.. but i'll include the scripts so hopefully someone can help me figure out what im missing.... One script is part of the BASE QUEST ..the second handles the "fuel" tankand the light script (last) is activated when you turn on various light switches (lights are tied to markers ... when you turn on a light swtich it turns on all the light enabled by a particular marker) The marker is enabled if there is fuel in the tank. Again, I had it working and cant figure out what I changed... (jnitially disabled, enable parent, link ref or what) If you want to look at the mod/esp >>> look at the Restoration movement mod in my signature. THANKS!!!!!!!!! $$$$$$$$$$$$$$$$$$$$$$$$ POWER BASE SCRIPT {RAN AS PART OF THE BASE QUEST}---scn BlackbriarPowerBaseQuestScript int Fuel ; This is the total fuel units in stockint 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 ;Lghts7 uses 1 unit of Fuel/5sec If BlackbriarLgts7.GetDisabled Else set FuelRqd to FuelRqd + 3 Endif ;Lghts8 uses 1 unit of Fuel/5sec If BlackbriarLgts8.GetDisabled Else set FuelRqd to FuelRqd + 1 Endif ;Lghts9a uses 1 unit of Fuel/5sec If BlackbriarLgts9a.GetDisabled Else set FuelRqd to FuelRqd + 1 Endif ;Lghts10a uses 1 unit of Fuel/5sec If BlackbriarLgts10a.GetDisabled Else set FuelRqd to FuelRqd + 1 Endif ;Lghts11 uses 1 unit of Fuel/5sec If BlackbriarLgts11.GetDisabled Else set FuelRqd to FuelRqd + 1 Endif ;Lghts12 uses 1 unit of Fuel/5sec If BlackbriarLgts12.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 BlackbriarLgts7.Disable BlackbriarLgts8.Disable BlackbriarLgts9a.Disable BlackbriarLgts10a.Disable BlackbriarLgts11.Disable BlackbriarLgts12.Disable Endif End $$$$$$$$$$$$$$$$$$$$ NEXT SCRIPT$$$$$$$$$$$$$$$$$$$$$ Fuel Tank Script scn BlackbriarFuelTankBegin onActivate If GetQuestRunning BlackbriarPowerBaseQuest Else StartQuest BlackbriarPowerBaseQuest Endif If player.GetItemCount FissionBattery player.removeItem FissionBattery 1 set BlackbriarPowerBaseQuest.Fuel to BlackbriarPowerBaseQuest.Fuel + 1500 Else; ShowMessage BlackbriarPowerNoBatteries ; Uncomment when/if you want to display a msg. EndifEnd $$$$$$$$$$$$$$$$$$$NEXT SCRIPT$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Power light script 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 ActivateEnd Link to comment Share on other sites More sharing options...
Recommended Posts