How could I make a perk do this in New Vegas?
Posted 15 January 2012 - 02:07 AM
Posted 15 January 2012 - 03:42 PM
Unfortunately I haven't got quite as much time to explore this as I would like but in brief I would use perks Tag or Animal Friend as a base. Rather than adding a value to the player they are used to set the stage on a quest (the quest Generic) with an associated script.
The way I would go about your request would be to either add a new quest or add a new stage to the Generic quest for your perk. The attached script would set a new Global variable to true i.e.
set perkAddItemRand 1Then set up a new miscellaneous script which checks for this global variable. The script would then run a timer (see these tutorials by Cipscis for more on intro scripting including timers). For the random item I would set up a new Form List containing your items or refer to an existing one.
I hope that there's enough here to point you in the right direction, best of luck!
Posted 17 January 2012 - 11:03 PM
Posted 18 January 2012 - 06:50 PM
The problem with the New Vegas GECK is that it doesn't report errors in scripts... and if there is an error in your script it won't save it. I personally use this mod, GECK PowerUp, to enable error reporting.
Thanks for the information. One problem, though: Every time I try to add a script to the stage I put in Generic, and either close the box, or switch to another stage and come back, it's gone. It's obviously not saving. But why? What do I specifically do to save it? I've tried a few things, but nothing worked.
Either way, the steps I've followed to achieve the quest script (by much trial-and-error I must admit!) are as follow:
1 - Create the new Global variable.
If you write your script before the variable it references is created, it will fail validation and not save. Unlike other objects a new Global variable cannot be created by right clicking in the object window. You need to go to Gameplay at the top of the GECK window, then Globals..., then you can right-click and select New as normal. I used the formID PerkAddItemRand. Then make sure the type checked is Short and the value is 0.
2 - Write the Quest script
I then added a stage 115 to the Generic quest and added an EMPTY Log Entry. In the Result Script box I added the following:
; Set flag to add random items to player as per perk
set perkAddItemRand to 1
I missed the 'to' from my initial script which would also cause it to break.
Hit Compile Result and then Ok at the bottom of the window.
That should do the trick!
Posted 19 January 2012 - 12:24 AM
scn AddItemPerk float timer float fQuestDelayTime begin gameMode if perkAddItemRand == 1 set fQuestDelayTime to 0.001 if ( time < 720 ) set time to timer + getSecondsPassed elseif ( time >= 720 ) player.additem f 100 endif endif end
I know there's something horribly wrong with that. Horribly, horribly wrong. Many things horribly wrong and immoral. Basically, I want to have a timer be activated when perkAddItemRand returns 1. That timer will give the player a random item every 12 minutes (for now). Since making it so the player does receive a random item is a whole other ballpark; right now I'm just trying to get 100 caps to work.
GECK Power Up keeps giving me an error saying fQuestDelayTime isn't a valid variable name. I just followed the tutorial. Are they not telling me things, now? I feel so out of the loop...
I am confus.
Posted 19 January 2012 - 01:00 AM
Change all the parts where you have 'time' to 'timer'.
You also need to make sure 'perkAddItemRand' is defined as a global variable.
Another thing, 'fQuestDelayTime' can only be used in a quest script. Did you change the script-type to in the drop-down to a quest type?
Posted 19 January 2012 - 01:21 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users