Page 2 of 4

Re: GUI Party Dialogue Journal

Posted: Thu Jun 06, 2013 4:01 pm
by msyblade
Edit: I reread the post and saw where you get the error. Im headed to work, and will check it out this evening for you. For nor, i can only suggest to double check the spelling/syntax on the SE's you placed to make sure they are exactly correct. And place the onDraw hook at the END of the init. If those are both okay, let me know and ill be around in 7 or 8 hrs and run through it with you :) I may need to put the script in a sample dungeon.dat file, so it can be copy/pasted from there, in case taking it from wordpad is causing any syntax malfunctions during transposition. A new, niftier version will be released in the next couple of days, and in that version, i will put the script in a dungeon.dat SE. You are getting the error when another script adds a line to the journal, yes?

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 12:59 am
by msyblade
Also be sure that any line you try to add to the journal has quotations " 's before and after, like a hudprint. It needs to create a string out of it.

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 3:11 am
by Ryeath_Greystalk
msyblade wrote:Also be sure that any line you try to add to the journal has quotations " 's before and after, like a hudprint. It needs to create a string out of it.
I have my line

Code: Select all

elseif count == 0 then
		dungeon_door_wooden_11:open()
		mdConversationList:addItem("The party found themselves in Steeprock Old Towne.")
	end
I have my init.lua

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.6

-- import standard assets
import "assets/scripts/standard_assets.lua"

-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/wall_sets.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"
import "mod_assets/plugins/slugomorg/slugomorg.lua" -- custom monster Slugomorg created by Leki
import "mod_assets/plugins/skeleton_warrior_sword/skeleton_warrior_sword.lua" -- custom monster Skeleton Warrior - Sword created by Leki
import "mod_assets/plugins/ghoul/ghoul.lua" -- custom monster Ghoul created by Leki
import "mod_assets/log_desk/log_desk.lua"
import "mod_assets/grim_bed/grim_bed.lua"
import "mod_assets/cultist/scripts/monsters.lua"
import "mod_assets/cultist/scripts/materials.lua"

cloneObject{
	name = "party",
	baseObject = "party",
	onDrawGui = function(ctx)
		mdConversationList.onDraw(ctx)
		end,
	onDie = function(deadPlayer)
		knocked_out_script.knockedOut()
		end,	
}
Only thing I did here was copy my onDie hook and added a comma at the end of your onDraw hook

I have a script entity named mdConversationList

The error has to do with concatenation a table value.

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 6:58 am
by msyblade
You are using it correctly, the scripts are fine :) Try placing the onDraw hook very last in the init, I had to place it after an onMove hook i use, it would not work when placed before. (And it broke the onMove). If you still get the error, a newer version will be released in the next couple of days, and it will have extended features. You are using it correctly, so at worst, remove it and install the new version. I am interested to see how you end up using it!

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 7:23 am
by Ryeath_Greystalk
Moving it to the end did not change anything, still get same error.

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 8:37 am
by Xanathar
You should use a dot before addItem, not a : sign of which I don't remember the name :)

sent from phone - I'll expand later

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 9:03 am
by msyblade
Or, it's that. :roll:

Re: GUI Party Dialogue Journal

Posted: Fri Jun 07, 2013 2:24 pm
by Ryeath_Greystalk
Thanks Xanathar.

Working now.

Image

Re: GUI Party Dialogue Journal

Posted: Sat Jun 08, 2013 3:56 am
by Mal85
This looks pretty cool, I'll have to give it a try. Thanks!

Re: GUI Party Dialogue Journal

Posted: Sun Jun 09, 2013 8:29 am
by Ryeath_Greystalk
Just a little thing I came up with (took 2 hours to get it right, pathetic I know).

Place a script entity in your mod and name it time_played_conversion
put the following code in,

Code: Select all

-- convert seconds to hour minute format

function timeConversion()

	local time_played = getStatistic("play_time")
	local hours = 0
	local minutes = 0
	local seconds = 0
	
	hours = math.floor(time_played / 3600)
	minutes = math.floor((time_played - (hours * 3600))/60)
	seconds = math.floor(time_played - (hours * 3600) - (minutes * 60))
	
	local total_time = ("Journal time: "..hours.." Hours, "..minutes.." Minutes, "..seconds.." Seconds.")
	
	 return total_time
end
and substitute the line
mdConversationList.addItem(getStatistic("play_time"))

with these two lines

Code: Select all

local total_time = time_played_conversion.timeConversion(total_time)
mdConversationList.addItem(""..total_time)
and you no longer get a big huge number of seconds, but an hour / minute display.

Image