Adding items through perks

Post » Sat May 28, 2011 8:53 am

Hello all. I was wondering if anyone could help me work out how to do this. I am making a mod that involves adding items to the player through a perk, and so far, I haven't been able to work out how. Does anybody know if this is possible?

Also, is it possible for a perk to have different level requirements for each rank, and if the first thing is possible as well, can you remove one set of items and add another through different ranks of a perk?

Thanks for any help I get.

Oh, and another thing while I think about it. Is it possible for an item to unequip the pipboy glove when the item is equipped, and then reequip the pipboy glove when the item is unequipped?
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Sat May 28, 2011 2:29 am

Just make the perk specify a quest stage, then write a result script for that quest stage that adds an item. Look at Animal Friend for an example of using quest stages in perks.
For the second thing, yes. The pipboy glove is just an item of clothing.
User avatar
Ashley Tamen
 
Posts: 3477
Joined: Sun Apr 08, 2007 6:17 am

Post » Sat May 28, 2011 2:17 am

Hello all. I was wondering if anyone could help me work out how to do this. I am making a mod that involves adding items to the player through a perk, and so far, I haven't been able to work out how. Does anybody know if this is possible?

Also, is it possible for a perk to have different level requirements for each rank, and if the first thing is possible as well, can you remove one set of items and add another through different ranks of a perk?

Thanks for any help I get.

Oh, and another thing while I think about it. Is it possible for an item to unequip the pipboy glove when the item is equipped, and then reequip the pipboy glove when the item is unequipped?


You can create a new quest and using a quest stage with "Player.AddItem" you can add item to player when player takes the perk.

It is not possible to have different level requirements for different rank. you can, however, create another perk with different level requirement.

and finally, you could check the player's inventory using GetItemCount function and see if player does own that item(s). and if so, use if-statement to take care of it.
User avatar
Connie Thomas
 
Posts: 3362
Joined: Sun Nov 19, 2006 9:58 am

Post » Fri May 27, 2011 11:27 pm

Do you think you could write those scripts out, as I really don't know what to write.
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Sat May 28, 2011 10:07 am

Can you write those scripts down then?
User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Sat May 28, 2011 8:47 am

Try them yourself- they're not hard. All you need is the Additem and Removeitem commands (look them up on the GECK wiki).
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Fri May 27, 2011 6:55 pm

I know those commands, but I don't know what a "result script" is.
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Sat May 28, 2011 9:39 am

Look at Animal Friend for an example of using quest stages in perks.

User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Sat May 28, 2011 2:30 am

you could probably also use an actor effect, which you put in the perk, with a scripted effect to do the same tho it might not be easier lol...

result scripts are mini scripts that you can specify in quests, terminals or dialogues, theres a white box in which you can write, astonishingly titled "result script" :P
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Fri May 27, 2011 9:54 pm

Alright, so I have done the adding items through perks bit. But I still don't know how to do the pipboy equip and unequip one. I know that I should use the commands player.unequipitem PipboyGlove and player.equipitem PipboyGlove, but I don't know how I would make it so that the Pipboy Glove is equipped when the item is unequipped, and vice versa. While I think about it, is it possible to make it so that the Pipboy Glove doesn't get equipped when the item is unequipped if the player didn't have the glove equipped prior to equipping the item?
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Fri May 27, 2011 7:22 pm

Put a script on the item that uses the Equip and Unequip blocks.
e.g.
Begin OnEquip;do thingEnd

You can use GetEquipped in the script to see if the player has the glove on when it's equipped, store that in a variable, and then use it to decide whether or not to re-equip the glove in your item's OnUnEquip block.
User avatar
lisa nuttall
 
Posts: 3277
Joined: Tue Jun 20, 2006 1:33 pm

Post » Sat May 28, 2011 2:41 am

I really do not know how to do most of what you are talking about.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Sat May 28, 2011 2:41 am

Have you even had a look at the scripting tutorials on the GECK wiki?
E: Or checked the script on an existing scripted item?
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Sat May 28, 2011 3:10 am

For the unequipping the pipboy glove when an item is equipped and then reequipping the Pipboy glove when the unequipped, would my script look something like:

scn VriskaClothesPipboyGloveBegin OnEquipunequip PipboyGloveelseBegin OnUnEquipequip PipboyGloveEnd


Does that look right?
User avatar
Alex Vincent
 
Posts: 3514
Joined: Thu Jun 28, 2007 9:31 pm

Post » Sat May 28, 2011 3:37 am

For the unequipping the pipboy glove when an item is equipped and then reequipping the Pipboy glove when the unequipped, would my script look something like:

scn VriskaClothesPipboyGloveBegin OnEquipunequip PipboyGloveelseBegin OnUnEquipequip PipboyGloveEnd


Does that look right?


That 'else' should be an 'end'.
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Fri May 27, 2011 7:11 pm

scn VriskaClothesPipboyGloveBegin OnEquip Playerplayer.unequipitem PipboyGloveEndBegin OnUnEquip Playerplayer.equipitem PipboyGloveEnd


Right, that is my current script. It seems to half work, in the fact that the HUD says the Pipboy Glove has been equipped, but when I look on my character, it hasn't. Anyone know how to fix this?

And it should run on the piece of clothing that I don't want the Pipboy glove on, right?
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Sat May 28, 2011 10:41 am

Yes.
The glove not appearing is a bit odd, could just be fixed by changing perspective, the model might not have loaded.
User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Sat May 28, 2011 7:55 am

I have worked out the problem. The glove wasn't in my inventory.
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Sat May 28, 2011 3:02 am

scn VriskaClothesPipboyGloveBegin OnEquip Playerplayer.removeitem PipboyGlove 100EndBegin OnUnEquip Playerplayer.additem PipboyGlove 1player.equipitem PipboyGloveEnd


That is my current code.

I know I need to use the GetEquipped command, but how do I store what I get from it as a variable? And then how would I do that code to run a different thing depending on what the result from the variable is?
User avatar
how solid
 
Posts: 3434
Joined: Mon Apr 23, 2007 5:27 am

Post » Sat May 28, 2011 3:50 am

Guys, I do actually need your help, as I really do not know what to do.

And I have looked through the wiki.
User avatar
Nicole M
 
Posts: 3501
Joined: Thu Jun 15, 2006 6:31 am

Post » Sat May 28, 2011 9:50 am

Is anyone actually going to give me any help?
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Fri May 27, 2011 7:28 pm

You're not entitled to it you know, particularly when you're asking a lot of questions about really basic things it's easy to figure out from looking at other scripts. In fact the very first script on the script list, 12GaCoinShotScript, has simple examples of using variables and if conditions.
User avatar
Elisabete Gaspar
 
Posts: 3558
Joined: Thu Aug 31, 2006 1:15 pm

Post » Sat May 28, 2011 10:15 am

And what if it scripting makes no sense to me whatsoever? This is the only script I have ever done (and ever plan on doing), and I really do not understand the other scripts. You might, but I don't.
User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm

Post » Fri May 27, 2011 7:18 pm

Right, I did actually get someone to help me, but now we are both stuck on the script. It currently unequips the glove, but won't reequip it. Anyone know how to fix this?

Code:
scn VriskaClothesPipboyGloveint InitGloveEquipped									; 0 = Glove not equipped, 1 = glove equipped initiallyBegin OnEquip	if player.GetEquipped PipBoyGlove == 1					; If this returns 1, it will run the following hooks:		set InitGloveEquipped to 1						; Sets the integer to 1 so that it will equip the glove when unequipping the clothes		player.UnequipItem PipBoyGlove	1 1			; Removes the glove (Wow what a surprise!!!) hiddenly	endifEndBegin OnUnequip	if InitGloveEquipped == 1							; Checks if the glove was equipped when you put on your clothes, returns 1 if it was.		player.AddItem pipboyglove 1 1		player.EquipItem PipBoyGlove 1 1		set InitGloveEquipped to 0						; Sets the integer back to 0 so if the PC will (somehow) unequip the glove, it won't equip it again.	endifEnd

User avatar
Jeneene Hunte
 
Posts: 3478
Joined: Mon Sep 11, 2006 3:18 pm

Post » Sat May 28, 2011 12:07 am

Anyone know how to fix this then?
User avatar
I’m my own
 
Posts: 3344
Joined: Tue Oct 10, 2006 2:55 am


Return to Fallout: New Vegas