Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

How could I make a perk do this in New Vegas?


Expresate
 Share

Recommended Posts

Hey, I'm trying to put together a perk just for the heck of doing it. I know how to add perks. What I don't know is how to properly script for a perk to do something. How would I make it so my perk, upon being selected, would reward the player with a random item every X number of hours? Any idea?

Link to comment
Share on other sites

Hi,

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 1

Then 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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.

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!

Link to comment
Share on other sites

I'm just going to say I have no idea what I'm doing. I've got everything done but the actual script. Basically, I walked into the nearest timer tutorial (This one right here: http://cs.elderscrolls.com/index.php/Scripting_Tutorial:_Creating_a_Simple_Timer), picked random things off the shelves, and left. Ended up with this:


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.

Link to comment
Share on other sites

Quickly looking over the script, you do not have a variable defined called 'time'.

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...