Jump to content

Applying scripts to the player?


IceDolphin

Recommended Posts

Hey guys, well I'v recently been adding mods to my Fallout New Vegas, and Bethesda made Skyrim and Fallout Nv so I gave making mods for Fallout a try, Turns out i'm good at scripting although I'm still a complete noob. So I'v found out in order for a script to be active it has to be attached to something, and I'm working on a mod that brings up a message box everytime you enter combat, so I was wondering if you can attach scripts to the player, if so How? Thanks for you're input.

Edited by IceDolphin
Link to comment
Share on other sites

What I would do is use a dummy Quest as a carrier of a script that would run in the background, monitoring the number of kills and adding the caps whenever the latter is incremented.
1. Create a new Quest, tick Start Game Enabled and set Script Processing Delay to 1.0
2. Crate a new Script, set Script Type to Quest, and use the following code:
scn	AddCapsForKillsScript

short	iKills
short	iTemp
short	iCaps

begin GameMode

	set iTemp to GetPCMiscStat "Total Things Killed"
	if iKills == 0
		set iKills to iTemp
	elseif iTemp > iKills
		set iCaps to (iTemp - iKills) * 25
		player.AddItem Caps001 iCaps
		set iKills to iTemp
	endif

end

3. Re-open the Quest from step 1 and select this script from the dropbox.

Link to comment
Share on other sites

Yes, you can, but there is no reason to do so. Simply use the method I demonstrated above (a quest script) when you need a script to run on the player. You can also use an item (as Mish suggested), or an Actor Effect, but those methods are somewhat more complicated and less reliable.

Link to comment
Share on other sites

To count kills, I usually use a perk with the "add leveled list on death" entry point and a token with an object script that adds one to a counter and removes itself. This allows you to set exclusions so that only killing certain enemies adds to a count, etc.

 

Jazz's method is a lot simpler if you don't want to dig too deeply into scripting.

Link to comment
Share on other sites

I do want to be the very best scripter, that no one ever was! But currently i'm still quite new to it, I'm trying to think of something creative but no to difficult I can come up with to test my knowledge.

 

 

Oviousely I want to dig deep into it, but i'm not making things harder for me, i'm using Jazz's method because it's easier. And I don't like the thought of dragging an item around just for the effect.

Edited by IceDolphin
Link to comment
Share on other sites

  • Recently Browsing   0 members

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