Jump to content

Script question


bnxus

Recommended Posts

Hi guys, I've got a little problem writing a script for the King Gang Members. What I'd like to accomplish is a script that makes the King Gang Members respawn after 7 days if they're dead. The conditions for them being resurrected after a week are the follwing: 1. They're dead 2. vStoryEventKings is 0 (if they got wiped out by the player during the 'King's Gambit' quest they shall no longer respawn). The main problem is that I don't know how to handle the GameDaysPassed part. Can somebody help me with this? Thanks in advance! Edited by bnxus
Link to comment
Share on other sites

Why not just check the "Respawns" box in the NPC form for the King Gang members?

Because it would make them respawn always, even if the player has wiped out the Kings in the King's Gambit quest... and I want them to stop respawning if it comes to this.

Edited by bnxus
Link to comment
Share on other sites

Because it would make them respawn always, even if the player has wiped out the Kings in the King's Gambit quest... and I want them to stop respawning if it comes to this.

 

Well you'd probably want to attach a script to the king's members you want to respawn with a onDeath block to store the global value GameDay when they died.. Maybe KingsRef1DeadDay for the 1st guy, KingsRef2DeadDay for the 2nd guy etc . That can be tied into a quest and it's associated script. The quest script could be executed once an hour instead of the default, and have a pretty simple if block with a >= 7 + GameDay && vStoryEventKings == 0, that could execute a ResurrectActor command. Also instead of doing a if/else to cover each king gangs member you could put them all in a form list and pass them as a variable with conditions. That way if it accepts them, it should just execute once an hour on the first member on the form list going from top till bottom until one qualifies.

Link to comment
Share on other sites

Could this script work out?

 

scn VFSKingGangMemberSCRIPT

short DeathDay
short CurrentDay
int bDead

begin OnDeath

set DeathDay to GameDaysPassed
set bDead to 1

end

begin OnLoad

if bDead == 1 && vStoryEventKings == 0

	set CurrentDay to GameDaysPassed

	if ( CurrentDay - DeathDay ) >= 1

		Resurrect
		ResetAI
		set bDead to 0

	endif

endif

end

 

EDIT: Yes, seems to work! :dance:

Edited by bnxus
Link to comment
Share on other sites

  • Recently Browsing   0 members

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