Fable3mod
Discussions for modifying Fable 3

Home » Modding Forums » Modding Discussion » Question about scriptactivation
Question about scriptactivation Sat, 09 November 2013 07:41 Go to next message
thid is currently offline  thid
Messages: 5
Registered: November 2013
Junior Member
I read the tutorial on forum about editing scriptactivation, after looking at Phnx post but can't realy find a way to make those functions to work. Following tutorial I change my scriptactivation.lua with those lines

ScriptActivation[ScriptCode.QU000].AbleToRun = function()

Debug.GiveAllMeleeWeapons()
Debug.GiveAllRangedWeapons()
Debug.GiveAllSpellGauntlets()
Debug.AddAllInventoryItemsF2()
Debug.AddAllInventoryItems()
Debug.SetCombatFinishersTestMode([toggle:true])
ScriptFunction.SetHeroAsASmoker()

return nil
end


but this doesn't work at all, could anyone give me some suggestions (webarchive don't have any posts only categorys Sad Wink

Re: Question about scriptactivation Sat, 09 November 2013 21:32 Go to previous messageGo to next message
asmcint is currently offline  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 Sat, 09 November 2013 22:11 Go to previous messageGo to next message
Artofeel is currently offline  Artofeel
Messages: 195
Registered: August 2013
Location: Russia
Senior Member
thid wrote on Sat, 09 November 2013 20:41
I read the tutorial on forum about editing scriptactivation, after looking at Phnx post but can't realy find a way to make those functions to work. Following tutorial I change my scriptactivation.lua with those lines

ScriptActivation[ScriptCode.QU000].AbleToRun = function()

Debug.GiveAllMeleeWeapons()
Debug.GiveAllRangedWeapons()
Debug.GiveAllSpellGauntlets()
Debug.AddAllInventoryItemsF2()
Debug.AddAllInventoryItems()
Debug.SetCombatFinishersTestMode([toggle:true])
ScriptFunction.SetHeroAsASmoker()

return nil
end


but this doesn't work at all, could anyone give me some suggestions (webarchive don't have any posts only categorys :( )


This is old way of hijacking
better is use your own quest script, or just newgame.lua
and you have some errors
correct
ScriptActivation[ScriptCode.QU000].AbleToRun = function()

Debug.GiveAllMeleeWeapons()
Debug.GiveAllRangedWeapons()
Debug.GiveAllSpellGauntlets()
Debug.AddAllInventoryItemsF2()
Debug.AddAllInventoryItems()
Debug.SetCombatFinishersTestMode(true)
ScriptFunction.SetHeroAsASmoker()

return true
end


'([toggle:true])' just broke all script
and 'return true' looks more correct
Re: Question about scriptactivation Sun, 10 November 2013 05:22 Go to previous messageGo to next message
Keshire is currently offline  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

[Updated on: Sun, 10 November 2013 05:22]

Report message to a moderator

Re: Question about scriptactivation Sun, 10 November 2013 13:57 Go to previous messageGo to next message
thid is currently offline  thid
Messages: 5
Registered: November 2013
Junior Member
Quote:
'([toggle:true]Wink' just broke all script
and 'return true' looks more correct

thx for this, I just notice the fail I made with this Razz didn't do anything in lua for over 4 years and I totaly forgot syntax

Thank you Keshire for this reference script, it worked out for some testing Smile

I 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)?

[Updated on: Sun, 10 November 2013 13:57]

Report message to a moderator

Re: Question about scriptactivation Sun, 10 November 2013 14:10 Go to previous messageGo to next message
Keshire is currently offline  Keshire
Messages: 137
Registered: August 2013
Senior Member
thid wrote on Sun, 10 November 2013 13:57
Quote:
'([toggle:true]Wink' just broke all script
and 'return true' looks more correct

thx for this, I just notice the fail I made with this Razz didn't do anything in lua for over 4 years and I totaly forgot syntax

Thank you Keshire for this reference script, it worked out for some testing Smile

I 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)?


Absolutely. If you can figure out where and when you want something to run. You can also start your own quest script. And Quasar did some stuff to make that easier, but I don't think I've uploaded that stuff yet.

The kicker is that we have barely any reference to how stuff 'should' run. Like activating and deactivating level layers, and suspending quests that could interfere.

Since you mention it. I think I might disassemble the job manager stuff and see if we can set up something like the courier stuff.
Re: Question about scriptactivation Sun, 10 November 2013 22:51 Go to previous message
Artofeel is currently offline  Artofeel
Messages: 195
Registered: August 2013
Location: Russia
Senior Member
thid wrote on Mon, 11 November 2013 02:57
I 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...
Previous Topic: I'm curious
Next Topic: Quest template (qt000_template.lua)
Goto Forum:
  


Current Time: Tue Nov 26 21:45:39 PST 2024

Total time taken to generate the page: 0.01549 seconds