Hi again Guys...
Please I really need to work this (init.lua) file out desperately..
I want to add the following 2 Scripts to my init file.. I have tried hard but don't know how to do it, I have asked others but no replys (sorry not being rude here)...
1 - The function for:
-- Search Floor Script
-- Version: 3.0.0
-- Released: 12.8.2013
-- Author: AdrTru canibalized code
-- by JohnWordsworth QuickBar
onDrawGui = function(g) ----Not sure if this NEEDED----------
if ( search_script ~= nil and search_script.onDrawGui ~= nil ) then
search_script.onDrawGui(g);
end
end,
2 - The Function for:
-- Legend of Grimrock QuickBar
-- Version: 0.9.1
-- Author: JohnWordsworth
-- Quick Bar Hook
if ( qb_script ~= nil and qb_script.onDrawGui ~= nil ) then
qb_script.onDrawGui(g);
end
----------This My Current init.lua file..Need to Add the 2 Above Function to this init file ------------
--- USE THIS SCRIPT ALL GAMES ---
--- import standard assets---
import "assets/scripts/standard_assets.lua"
import "mod_assets/framework/framework.lua"
import "mod_assets/dx_sky_system/dx_sky_system.lua" --- By: Diarmund ---
import "mod_assets/gui/initgui.lua" --- This is the Shop Framework by:Allios ---
cloneObject {
name = "party",
baseObject = "party",
onDrawGui = function(g)
return gui.onDrawGui(g)
end,
onMove = function(self, dir)
skyScript.onMove(dir)
if (gui.globalVars["shopOn"]) then
return false
else
return true
end
end,
onPickUpItem = function(champion, item)
if ( item.name == "book_undead_v2" )then playSound("mine_horror07") end ----- Is this the problem, this is line 111 ----
if ( item.name == "the_king" )then playSound("mine_horror04")
end
end
}
This all works ATM but would like to know how to add the above Functions in, but I don't understand all the Ondrawgui functions and how to put them together..
Thxs again...
Please help Me with my init.lua File THXS
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Please help Me with my init.lua File THXS
Hi,
I thing that you must connect scripts in ONE party. - change onDrawGui in your party script:
Next error I dont know.
Are you sure that you have a correct definition of sound in playSound function?
I thing that you must connect scripts in ONE party. - change onDrawGui in your party script:
Code: Select all
cloneObject {
name = "party",
baseObject = "party",
onDrawGui = function(g)
if ( search_script ~= nil and search_script.onDrawGui ~= nil ) then
search_script.onDrawGui(g);
end
if ( qb_script ~= nil and qb_script.onDrawGui ~= nil ) then
qb_script.onDrawGui(g);
end
return gui.onDrawGui(g)
end,
...
Are you sure that you have a correct definition of sound in playSound function?
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
MultiAlcoveManager, Toolbox, Graphic text,
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Please help Me with my init.lua File THXS
Hi AdrTru Thxs for the help.. I have wanted this help for so long thxs...
Yes the sound comes from another Module it does work NP there.. Thats the onPickUp routine...
The Script you did is good but its missing the Shop and Sky system Scripts.. eg the shopon bit and the
Sky system bit: as below, where would this go into Script you have done for me..
onMove = function(self, dir)
skyScript.onMove(dir)
if (gui.globalVars["shopOn"]) then
return false
else
return true
end
end,
Once again thank you for your Excellent help here...
EDIT: Oh i see what you mean ----Is this the problem,this line111 ---- (Yeah i forgot to delete this out of my init Script).
Yes the sound comes from another Module it does work NP there.. Thats the onPickUp routine...
The Script you did is good but its missing the Shop and Sky system Scripts.. eg the shopon bit and the
Sky system bit: as below, where would this go into Script you have done for me..
onMove = function(self, dir)
skyScript.onMove(dir)
if (gui.globalVars["shopOn"]) then
return false
else
return true
end
end,
Once again thank you for your Excellent help here...
EDIT: Oh i see what you mean ----Is this the problem,this line111 ---- (Yeah i forgot to delete this out of my init Script).
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Please help Me with my init.lua File THXS
Hi AdrTru how are you.. good I hope. Imma feel Great....
Well guess what I got it all to work thanks to you.. I still need to do more testing but ATM it's all working..
I have the Quick Bar, Search On Floor, The Shop Sys, The Sky Sys and OnPickup routines all working.. I am so excited right now it's JUST AWESOME...
Now I have everything I need.. THANK YOU FOR HELP MAN, it opened my eyes up (LOL)..
Anyhow here is my fianal (init.lua) Script, so you can see it works.. Once Thank You...
-- This file has been generated by Dungeon Editor 1.3.7
--- import standard assets ---
import "assets/scripts/standard_assets.lua"
import "mod_assets/framework/framework.lua" --Log Framework--
fw_setShowWarnings(false) -- don't show warning about script entites found from dungeon
fw_loadModule('fw_magic')
fw_loadModule('add_spells')
fw_loadModule('illusion_walls')
import "mod_assets/grimwidgets/grimwidgets.lua"
import "mod_assets/scripts/flooded_dungeon.lua"
import "mod_assets/dx_sky_system/dx_sky_system.lua"
import "mod_assets/gui/initgui.lua" --Shop--
import "mod_assets/gui/initgui.lua"
cloneObject {
name = "party",
baseObject = "party",
onDrawGui = function(g)
if ( search_script ~= nil and search_script.onDrawGui ~= nil ) then
search_script.onDrawGui(g);
end
if ( qb_script ~= nil and qb_script.onDrawGui ~= nil ) then
qb_script.onDrawGui(g);
end
return gui.onDrawGui(g)
end,
onMove = function(self, dir)
skyScript.onMove(dir)
if (gui.globalVars["shopOn"]) then
return false
else
return true
end
end,
onPickUpItem = function(champion, item)
if ( item.name == "book_undead_v2" ) then
playSound("level_up")
end
end
}
Well guess what I got it all to work thanks to you.. I still need to do more testing but ATM it's all working..
I have the Quick Bar, Search On Floor, The Shop Sys, The Sky Sys and OnPickup routines all working.. I am so excited right now it's JUST AWESOME...
Now I have everything I need.. THANK YOU FOR HELP MAN, it opened my eyes up (LOL)..
Anyhow here is my fianal (init.lua) Script, so you can see it works.. Once Thank You...
-- This file has been generated by Dungeon Editor 1.3.7
--- import standard assets ---
import "assets/scripts/standard_assets.lua"
import "mod_assets/framework/framework.lua" --Log Framework--
fw_setShowWarnings(false) -- don't show warning about script entites found from dungeon
fw_loadModule('fw_magic')
fw_loadModule('add_spells')
fw_loadModule('illusion_walls')
import "mod_assets/grimwidgets/grimwidgets.lua"
import "mod_assets/scripts/flooded_dungeon.lua"
import "mod_assets/dx_sky_system/dx_sky_system.lua"
import "mod_assets/gui/initgui.lua" --Shop--
import "mod_assets/gui/initgui.lua"
cloneObject {
name = "party",
baseObject = "party",
onDrawGui = function(g)
if ( search_script ~= nil and search_script.onDrawGui ~= nil ) then
search_script.onDrawGui(g);
end
if ( qb_script ~= nil and qb_script.onDrawGui ~= nil ) then
qb_script.onDrawGui(g);
end
return gui.onDrawGui(g)
end,
onMove = function(self, dir)
skyScript.onMove(dir)
if (gui.globalVars["shopOn"]) then
return false
else
return true
end
end,
onPickUpItem = function(champion, item)
if ( item.name == "book_undead_v2" ) then
playSound("level_up")
end
end
}