Jump to content

Photo

Creating a script/quest that runs every time the game is loaded


  • Please log in to reply
4 replies to this topic

#1
SHAD0WC0BRA

SHAD0WC0BRA

    Fan

  • Members
  • PipPipPip
  • 290 posts

Pretty much the first time I'm creating an optional NVSE version for a mod and I'm running into problems. I'm used to functions that permanently affect saves (e.g. form list and leveled list stuff) which are attached to quests. Searched for a solution but perhaps my terms weren't good. Anyway, trying to figure out if the problem is in the quest form, the script, if something else entirely needs to be done. Here's the script, for reference.

scn 0AER14SW9700GreenScript

begin GameMode
	if GetNVSEVersion > 0
		SetWeaponCritEffect LaserDisintegrationGreenFXSpell WeapLaserRifleUnique
		SetWeaponCritEffect LaserDisintegrationGreenFXSpell NVDLC05WeapGatlingLaserUnique
	else MessageBox "This version of AER14 and Sprtel-Wood 9700 Green Critical Disintegration requires NVSE."
	endif
	StopQuest 0AER14SW9700GreenQuest
end

Edited by SHAD0WC0BRA, 23 May 2020 - 07:47 PM.


#2
punchbattle

punchbattle

    Fan

  • Members
  • PipPipPip
  • 318 posts

I think these are what you're looking for!

 

https://geckwiki.com...p/GetGameLoaded

https://geckwiki.com...etGameRestarted



#3
SHAD0WC0BRA

SHAD0WC0BRA

    Fan

  • Members
  • PipPipPip
  • 290 posts

 

I think "GetGameLoaded" is what I need to use. I want to make sure that this will work before I release a new version, though. If I put everything under "begin GameMode" in a "if GetGameLoaded == 1" block then will that cause the quest/script to run every time the game is loaded? Or is there something more I need to do?



#4
dubiousintent

dubiousintent

    Resident poster

  • Premium Member
  • 7,877 posts

You might want to check out "TIP Master Dependency Checking", "TIP Preload Scripts", and "TIP Block Types Multiple vs Single Frame processing" under the "Scripting" section of the wiki "Getting started creating mods using GECK" article.

 

-Dubious-
 



#5
punchbattle

punchbattle

    Fan

  • Members
  • PipPipPip
  • 318 posts

The way I check if / how often a script is running is by printing a message at the top of the block, like this:

scn 0AER14SW9700GreenScript

begin GameMode

	PrintToConsole "running!";

	if GetNVSEVersion > 0
		SetWeaponCritEffect LaserDisintegrationGreenFXSpell WeapLaserRifleUnique
		SetWeaponCritEffect LaserDisintegrationGreenFXSpell NVDLC05WeapGatlingLaserUnique
	else MessageBox "This version of AER14 and Sprtel-Wood 9700 Green Critical Disintegration requires NVSE."
	endif
	StopQuest 0AER14SW9700GreenQuest
end

Then, once you're in-game, just open the dev console every once in a while and see how often the message pops up!






Page loaded in: 0.951 seconds