SevenBlue Posted April 2, 2017 Share Posted April 2, 2017 I'm attempting to make a bounty mod in the style of the Lawbringer perk from fallout 3 The way I'm handling it is you can only start collecting fingers from a faction once you know that there is a bounty on them. So picking up a note will give the player the perk "Bounty: Powder Gangers" for example. Conditions Target: GetInFaction=7BPowderGangerBounty, GetDead=Dead Activate-Add Activate Choice- Cut off finger Player.AddItem 7BPowderGangerFinger 1Target. Removefromfaction7BPowderGangerBounty I've added all the necessary generic powder gangers to the faction, but as it stands the player would be able to harvest unlimited fingers from one powder ganger corpse. I looked around for how to add a custom condition function but wasn't able to find anything. Does anyone have any suggestions? Link to comment Share on other sites More sharing options...
SevenBlue Posted April 8, 2017 Author Share Posted April 8, 2017 New problem to add to the list if anyone can help. I'm trying to write a basic code that will will turn on a light, and switch on a noise when the player presses a button, and turn them back off again if they press the button a second time. Want to make sure I understand the core concept of linking multiple items to a single ref before I try anything more ambitious. I have the light and the noise linked to an x marker as their parent. But when I try and save the actual switch script on the activator I get the following error message. (I'm using GECK, PowerUp's update by hlp) SCRIPTS: Script 'SBSwitchScript', line 6:Unknown variable 'Enable'. Script below scn SBSwitchScript Begin OnActivate If (SBXSwitchRef.GetDisabled == 1) set SBXSwitchRef.Enable Else set SBXSwitchRef.Disable EndIf EndIf anyone could provide insight into what I'm doing wrong it would be greatly appreciated, I can't for the life of me figure it out. Any guidance on my finger drop problem (I'm trying to hobble together an altered version of Lawbringer from FO3) I would value that highly. Link to comment Share on other sites More sharing options...
Mktavish Posted April 8, 2017 Share Posted April 8, 2017 (edited) Get rid of the "Set" in those lines. When you use it ... it wants to look at a declared variable which you would have listed before using set. So it is thinking that "Enable" is another variable holding a value that you want to set your ref with.At least I'm guessing to the explanation of the error it's returning. And I'm saying the error is confused in telling you what it thinks is wrong. The correct way to use set is like this . Set MyRef to MyotherRef ... but can also be used with the other types of variables ... integers and floats , which you would set them with a number ... Set MyInt to 1 example ... , and conditionals you would use "Get" with. "Set MyInt to MyRef.Getdisabled" which would return 0/1 and set "MyInt" to the same value as MyRef. Set is a command , just like "Enable / Disable are commands ... which you only need to list the " reference.Enable / Disable " And on your other problem with unlimited finger harvesting ... you just need to declare a variable of "DoOnce" and use it like this. And you shouldn't have to remove them from the faction , no need if the only thing is to keep it from continuing to give player a finger. SCN MyFingerScript Int DoOnce Begin OnActivate If DoOnce == 0 Player.AddItem 7BPowderGangerFinger 1 Set DoOnce to 1 endifEnd Hope that helps Add edit : Oh ya , you could use an On/Off Int variable for the switch. Off == 0 / On == 1So a script that looks like this ... scn SBSwitchScriptInt SwitchOn Begin OnActivate If SwitchOn == 0 SBXSwitchRef.Enable set SwitchOn to 1 Elseif SwitchOn == 1 SBXSwitchRef.Disable set SwitchOn to 0 EndIf EndIf End Add edit : Whoops I had left the "Set" in the same line as Enable/Disable .... fixed now. Edited April 8, 2017 by Mktavish Link to comment Share on other sites More sharing options...
SevenBlue Posted April 10, 2017 Author Share Posted April 10, 2017 Thank you, your advice for the switch worked like a charm. I didn't realize I was messing up the command. I mean, well obviously otherwise I wouldn't needed to have asked. Your advice on the finger drop didn't work out though, turns out you can't use variables in perk entry activate scripts. I've done some poking and discovered some methods I could use to work around that. 1. I could go with my original plan of removing the actor from the faction once the finger has been collected, thus removing one of the conditions needed to collect the finger. My concern with this is I won't be able to work the script so that the actor gets removed from the faction, and not the base object it's pulled from. Since this is intended to work on respawning enemies that would be counter productive. 2. An invisible explosion effect could be placed on the player so that any dead bodies in a certain radius are checked to see they meet the prerequisites before a finger is added to their inventory. With this method it would probably be easier to set up a variable. 3. Issue could be resolved with the use of NVSE as lined out in this post by rickerhk which seems the cleanest but I'm reluctant to make NVSE a requirement for such a minor mod. In your opinion, which avenue do you suggest I pursue? Link to comment Share on other sites More sharing options...
Mktavish Posted April 12, 2017 Share Posted April 12, 2017 (edited) Well off the top go with # 3 and use NVSE . I don't know why people wana try and not use the script extender ?What it is is simply teaching the engine to use more language. Hence everybody should use a more language savy engine.Not like it is that hard to implement it in both geck and game either. But anyways ... a work around in my view would be to run another script setting the variable (placed on the NPC)Then use this command in the perk ... GetScriptVariable.MyNPC TheVariable == 1/0 Or use a quest script to declare the variable ... and in the perk ... then ask ... GetQuestVariable MyQuest TheVariable == 1/0 But Oh ya ... you need to set the variable with the OnActivate block from the script.And whoops ... looks like you can't do that without NVSE anyways. But ... there is still a work around ... if you are dead set on no NVSE ... I hope you recant that , but will wait till you decide. Edited April 12, 2017 by Mktavish Link to comment Share on other sites More sharing options...
SevenBlue Posted April 13, 2017 Author Share Posted April 13, 2017 (edited) Yeah I decided to give the SE method a try, I'll give it a test run when I finish setting up my load order later tonight. Thank you so much for your assistance so far, you've been an enormous help getting me on the right track! Edit: Alright I've been adjusting and tweaking this code for a few hours now, and I can't quite make it drop a single finger and move on. This is it's current incarnation but it won't even save at this juncture and I am too weak and broken spiritually and mentally to keep being independent and now beg for your help. scn SBPowderGangerDropScript ;Start game enabled, Quest delay 1 second ;Everywhere the player goes, dead and killed npcs will get updated ;Requires NVSE ref rTarget int DoOnce BEGIN GameMode showmessage WildWastelandMessage set rTarget to GetFirstRef 42 1 0 ; NPC 1 cell deep. Label 10 if rTarget if (rTarget.GetDisabled) else if (rTarget.GetDead) (rTarget.DoOnce == 0 (rTarget.GetInFaction SBPowderGangerBountyFaction == 1) rTarget.Setdoonce to 1 rTarget.AddItem SBPGFinger 1 ;A form list of all the items I want added else set rTarget to Pencil01 set rTarget to GetNextRef Goto 10 endif END GameModeEdit 2: The wild wasteland message is just there because I wasn't actually sure the script was running at one point. It was but the Powder Ganger spawners needed to have "use factions" turned on for the gangers to actually be in the proper faction I added. (I think) Edited April 13, 2017 by SevenBlue Link to comment Share on other sites More sharing options...
Mktavish Posted April 14, 2017 Share Posted April 14, 2017 (edited) Well what did you put this script on ? Obviously it is not in a Perk , type "Entry Point : Activate"Placed in the field for a script that would function from an "OnActivate" begin block.That is hard coded to that specific function of giving a secondary button to choose from when hovering the mouse pointer over an object and press "E" Hence no need for the "SCN" line or the "Begin" block.And from what you said is not able to declare a variable to then store a value to it.Which I assumed was true ... although functions calling to other things that hold scripts and variables , should be possible. Hmmm maybe we need to revisit how you are setting up the conditions for that type of perk , that then led to infinite finger looting ? Edited April 14, 2017 by Mktavish Link to comment Share on other sites More sharing options...
SevenBlue Posted April 14, 2017 Author Share Posted April 14, 2017 It's a quest script, runs every second while the quest is active. Instead of a an option to cut the finger off when the player loots the body, the finger just drops into their inventory as soon as the script registers that they meet the conditions. Sorry I should have mentioned it was a quest script, oversight on my part. Link to comment Share on other sites More sharing options...
Mktavish Posted April 15, 2017 Share Posted April 15, 2017 (edited) Well I can't see anything in particular wrong with it except the "END GameMode" Which should just be "END" Plus maybe how your parenthasees are only on 1 side But with your geck not telling you why it won't save ... you need to get "Geck power up" This I believe "http://www.nexusmods.com/newvegas/mods/41642/?" The NewVegas Geck does not have the same built in function that the Fallout 3 Geck does when compiling scripts. But sorry Ill give it a better look minyana , some of your logic may be off . Edited April 15, 2017 by Mktavish Link to comment Share on other sites More sharing options...
SevenBlue Posted April 15, 2017 Author Share Posted April 15, 2017 New rule. I'm not allowed to try and script when I can't even think straight. I managed to get the script to compile somewhere I made a mistake because the quest script is still not dropping the item into their inventories when they meet the parameters. I know the script is running because of the wild wasteland message, I know they are in the correct faction as I checked with console commands, I know the item is in the game properly because I spawned it with console commands into my inventory and into theirs just to see if I could. So I'm genuinely stumped, I even tried running the int: Formtype as 200 instead of 42. Here's what I got. scn SBPowderGangerDropScript ;Start game enabled, Quest delay 1 second ;Everywhere the player goes, dead and killed npcs will get updated ;Requires NVSE ref rTarget short iDoOnce BEGIN GameMode showmessage WildWastelandMessage set rTarget to GetFirstRef 42 1 0 ; NPC 1 cell deep. Label 10 if rTarget if (rTarget.GetDisabled) else if (rTarget.GetDead == 1) if (rTarget.Getinfaction SBPowderGangerBountyFaction == 1) if (rTarget iDoOnce == 0) rTarget.AddItem SBPGFinger 1 Set iDoOnce to + 1 else endif endif endif endif set rTarget to Pencil01 set rTarget to GetNextRef Goto 10 endif END And no rush, I just appreciate having someone help out! Link to comment Share on other sites More sharing options...
Recommended Posts