| 
		
 | 
	
		
		
			| Re: Question about scriptactivation  | 
			Sat, 09 November 2013 21:32    | 
		 
		
			
				
				
				
					
						  
						asmcint
						 Messages: 48 Registered: September 2013  Location: U.S.A.
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		I don't think debug commands are handled in the same way as functions, though I'm not entirely certain. Keshire had had a newgame lua uploaded with some debug commands for adding all dlc items, but that's gone. If it wasn't, I'd have taken a look at it as a reference to see how to trigger the debug commands. But I've never gotten the damn things to work in that manner.
		
		
  To whomever designed the map of Mistpeak Valley to look so much more simple than the actual level is: May the Archangel Michael descend from the heavens and plant his boot squarely between your legs for your asshattery.
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: Question about scriptactivation  | 
			Sun, 10 November 2013 05:22    | 
		 
		
			
				
				
				
					
						  
						Keshire
						 Messages: 137 Registered: August 2013 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Don't use this as is. It doesn't set the bowerstone castle layer correctly, so you can never return to it. I just use it for testing. 
Newgame.lua 
Toggle Spoiler
QuestManager.NewThread(GameflowThreadBase, "NewGameManager")
	
function NewGameManager:Init()
end
function NewGameManager:StateEnum()
end
function NewGameManager:InitialSetup()
end
function NewGameManager:Update()
	while not GUILevel.IsLevelLoaded("PVP_GUI\\FrontEnd") do
		coroutine.yield()
	end 
	
	coroutine.yield()
	
	SetInitialHeroEntityName("CreatureHero")
	GUIPlayer.ChangePlayerEntityType(GetLocalHero(), "CreatureHero")
	
	SetInitialWorldName("Fable3")
	SetInitialLevelName("Albion\\BowerstoneCastle")
	--SetInitialScenarioName("DefaultScenario")
	SetInitialScenarioName("GOOD")
	SetGameflowScriptEnum("QC180")
	SetGameflowScriptState("THERESA")
	SetLevelNameStartsWithACS("Albion\\BowerstoneCastle")
	SetOpeningLoadingScreen(true)
	
	SetSavingAsAllowed(true)
	TutorialManager.SetToPlayNewExpressionLearnedTutorials(true)
	TutorialManager.SetTutorialsEnabled(true)
	self:SetDefaultCamera()
	
	GameComponentSwitchManager.SwitchToMainGameFromRetailFrontEnd()
	self:Terminate()
	coroutine.yield()
	
end
function NewGameManager:OnExit()
	
	-- Initiate Kesfunction --
	GeneralScriptManager.AddScript(Kesfunction)
	
end
QuestManager.AddQuestThread(NewGameManager:new(), QuestManager.UpdateLists.GUI)
-- Testing stuff --
Kesfunction  = {}
function Kesfunction:Init()
end
function Kesfunction:Update()
	Gameflow.RoadToRule.UNLOCK_EVERYTHING(GetLocalHero())
	Debug.AddAllDLC1Items()
	Debug.AddAllDLC2Items()
	Debug.AddDLCDogBreedPack()
	Money.Add(GetLocalHero(), 10000000, 0)
	self:Terminate()
	coroutine.yield()
	
end
function Kesfunction:OnExit()
end
 
  
		
		
		[Updated on: Sun, 10 November 2013 05:22] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	
		
		
			| Re: Question about scriptactivation  | 
			Sun, 10 November 2013 22:51   | 
		 
		
			
				
				
				
					
						  
						Artofeel
						 Messages: 195 Registered: August 2013  Location: Russia
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		thid wrote on Mon, 11 November 2013 02:57I have 1 more question, how much we can mod scripts? after googling I found a way to make own quest but is it possible to make key trigger events (like F+T = gender change)?  
well, I use timming 
while true do
	coroutine.yield()
	
	if mod_last_run == nil or mod_last_run + 120 < Timing.GetWorldFrame() then	
		if GUI.IsScreenFading() then
			-- some stuff wnen new level is loading, or player go to sanctuary
			
		end
		-- main code here
		
		mod_last_run = Timing.GetWorldFrame()
	end
end
  
put it in 'NewGameManager:Update()' I think, because I use it in my own quest script in 'Main' section 
so, script repeated every 120 frames (2 seconds on 60fps) and if I need to do something heavy (something that will interfere to gameplay) I trigger it only when 'screen is fading' 
 
I tried to do trigger on the button, like: 
Debug.AddLuaDebugKeyFunc(EInputKey.KB_F9, Debug.ReloadCurrentLevel)
  
but I did not succeed...
		
		
		
 |  
	| 
		
	 | 
 
 
 |