Jump to content

Help with Actor Ref scripting


Roriksen

Recommended Posts

Hi all,

 

I've been working on a mod that makes raider armour more variable, plus gender specific so you could come across a female raider wearing Painspike Chest (female), Sadist trousers, Painspike Pauldrons ect, and if you loot her armour, even as a male PC you'll be wearing the Painspike wire mesh bra. Plus make them wearable over the vaultsuit (By making a skin tight version of the VS).

 

I have all the meshes for Breeze, Cali and Alice done, but am having some trouble with the scripting. I can link the armorraider01 to a script that forces the item to be destroyed and others added but only on the player's reference and have no idea how to make it work for all actors. I'd also like it to make a gender check if possible, ie a 5% chance a male raider will receive female armour and vice versa.

 

I could alter the leveleditems in geck but that unfortunatly wouldn't make it very random (As far as I know) plus would would make the gender specific unacheivable

 

this is all i've been able to get to work so far and i can only get that to work for the player ref, no other's

scn	WulfPainspikeSCRIPT

Ref	WPainspikeVanillaREF

BEGIN OnEquip Player

	if (Player.HasLoaded3D)
		set WPainspikeVanillaREF to Player.GetEquippedObject 2
		Player.UnequipItem WPainspikeVanillaREF
		Player.Additem WulfPSALc 1
		Player.Additem WulfPSARc 1
		Player.Additem WulfPSLLc 1
		Player.Additem WulfPSLRc 1
		Player.Additem WulfPSPUc 1
		Player.Additem WulfPSTUc 1
		Player.Additem WulfPSCMc 1
		Player.EquipItem WulfPSALc 0 1
		Player.EquipItem WulfPSARc 0 1
		Player.EquipItem WulfPSLLc 0 1
		Player.EquipItem WulfPSLRc 0 1
		Player.EquipItem WulfPSPUc 0 1
		Player.EquipItem WulfPSTUc 0 1
		Player.EquipItem WulfPSCMc 0 1
		Player.Removeitem ArmorRaider01 1
	endif

END

I don't know c++ at all, so was wondering as i've already done the meshes if anyone could help with the scripting? so instead of just

 

Additem WulfPSCMc 1

 

it could give a 25% chance of each

 

WulfPSALc

WulfSadALc

WulfBadALc

WulfBlastALc

 

and do gender checks with chest, trousers and pauldrons ect

 

Thanks

 

Edit:

 

Slowly getting it to work, found out that equip/unequip on NPC's was causing a CTD, just need to work on RNG

 

If anyone in the future happens to be looking to do some similar code

scn	WulfPainspikeSCRIPT

Ref	WulfActorREF

BEGIN Gamemode

	if GetContainer != Player
		set WulfActorRef to GetContainer
		WulfActorRef.Removeitem ArmorRaider01 1 1
		WulfActorRef.Additem WulfPSTUc 1
		if WulfActorRef.GetIsSex Male == 1
			WulfActorRef.Additem WulfPSCMc 1
		else
			WulfActorRef.Additem WulfPSCFc 1
		endif
	endif

END
Edited by Roriksen
Link to comment
Share on other sites

I think it would be better to change the inventory of the NPC to not have then items you want to add, and then add them in the OnLoad or OnReset block of a script that is on the NPC (not the armor). That is the way I have seen similar things done with other mods I have looked at.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...