Custom Housing Tool
Custom Housing Tool
Hi Turley!
can you give us some examples please, what is Custom Housing Tool, how it's work,
example of syshook?
can you give us some examples please, what is Custom Housing Tool, how it's work,
example of syshook?
Re: Custom Housing Tool
mmmh
on my testserver i have added a foundation (multiid 0x13ec - 0x147b)
then i have a textcmd with:
(this should be better added into your sign gump)
this is enough to play around with it
my hook currently only has debug prints:
this should be more like:
something like that
on my testserver i have added a foundation (multiid 0x13ec - 0x147b)
then i have a textcmd with:
Code: Select all
who.multi.setcustom(1);
SendHousingTool(who,who.multi);
this is enough to play around with it
my hook currently only has debug prints:
Code: Select all
Exported Function HookCustomHouseCommit(who,house, itemarray)
print(itemarray);
print(house.components);
return 1;
EndFunction
Code: Select all
(pseudocode)
Exported Function HookCustomHouseCommit(who,house, itemarray)
if (!sendgumpyesno("are you sure"))
return 0;
var oldprice:=CInt(house.getprop("price"));
var newprice:=CalcCosts(house.components,itemarray); // i think on osi its just a simple (house.components.size()+itemarray.size())*basecost
house.setprop("price",newprice); // store it for the next commit
var gold:=newprice - oldprice;
if (gold>0)
if (!who.spendgold(gold))
return 0;
endif
else
GiveGoldToPlayer(who,gold); // ...
endif
foreach component in house.components
if (component.graphic >= 0x181D and component.graphic <= 0x1828)
//link the teleporters with your teleportersystem
//on osi teleporters with the same graphic get linked
elseif (component.isa(POLCLASS_DOOR))
//modify if needed for your doorsystem
endif
endforeach
return 1;
endfunction
Re: Custom Housing Tool
SendHousingTool(who,who.multi); is not found in any module. How can we use it?
Re: Custom Housing Tool
That's because only cool people have it Edwards... 
joking aside, its a hidden feature of uo.em, you have to add the line in your uo.em yourself...
SendHousingTool(who, multi);
joking aside, its a hidden feature of uo.em, you have to add the line in your uo.em yourself...
SendHousingTool(who, multi);
Re: Custom Housing Tool
Turley, syshook was removed but scripts/misc/customhousecommit.ecl seems not work.
I've tested with this:
use uo;
program CustomHouseTool ( who, house, elem )
broadcast ("Size: " + elem.size());
house.acceptcommit(0);
return 1;
endprogram
But, no broadcast, and pol accept the commit even acceptcommit(0).
I've tested with this:
use uo;
program CustomHouseTool ( who, house, elem )
broadcast ("Size: " + elem.size());
house.acceptcommit(0);
return 1;
endprogram
But, no broadcast, and pol accept the commit even acceptcommit(0).
Re: Custom Housing Tool
OMG!
Nobody said it before
Let's test this awesome tool now
It's frustrating to not have heard of it before.
Edit: Ok so it only calls the hook. I started to script the gump side the other day when someone told me it wasn't necessary because it's already built-in for the next release which is not coming soon I think. This might be the only major feature missing with POL. I'm just expecting it to come available for us very soon. Let's hope for the best..
Nobody said it before
Let's test this awesome tool now
It's frustrating to not have heard of it before.
Edit: Ok so it only calls the hook. I started to script the gump side the other day when someone told me it wasn't necessary because it's already built-in for the next release which is not coming soon I think. This might be the only major feature missing with POL. I'm just expecting it to come available for us very soon. Let's hope for the best..
Re: Custom Housing Tool
fixed in rev333Terciob wrote:Turley, syshook was removed but scripts/misc/customhousecommit.ecl seems not work.
I've tested with this:
use uo;
program CustomHouseTool ( who, house, elem )
broadcast ("Size: " + elem.size());
house.acceptcommit(0);
return 1;
endprogram
But, no broadcast, and pol accept the commit even acceptcommit(0).
Re: Custom Housing Tool
Thanks Turley script is running now.
But, acceptcommit() seems to not work properly yet: when i press commit button, script run okey but my chr is Not moved out of the house, the gump of editing tool remains opened on my screen and house design do not change even house.acceptcommit(1).
If i close the gump with right mouse button (the only way to close it) next "sendhousingtool (chr, house)" returns "House currently being waiting for a commit" even if i press commit button and use house.acceptcommit(1) on script before.
But, acceptcommit() seems to not work properly yet: when i press commit button, script run okey but my chr is Not moved out of the house, the gump of editing tool remains opened on my screen and house design do not change even house.acceptcommit(1).
If i close the gump with right mouse button (the only way to close it) next "sendhousingtool (chr, house)" returns "House currently being waiting for a commit" even if i press commit button and use house.acceptcommit(1) on script before.
Re: Custom Housing Tool
You should print the result of .acceptcommit() 
I changed the params its now (chr,1/0)
but i also missed 2 files to commit, check rev334
I changed the params its now (chr,1/0)
but i also missed 2 files to commit, check rev334
Re: Custom Housing Tool
How to get the newest pol099Beta.exe for windows? I'd like to test it live!
Re: Custom Housing Tool
It would be awesome if some new function uo.em are added to commit items around the worlds and not always into multis. If it's possible
.
By the way, I test it today and it's simply funtastic! Good job again
By the way, I test it today and it's simply funtastic! Good job again
Re: Custom Housing Tool
likely not possible. I haven't looked into the packet breakdown yet but I know theres a packet that sends the revision number of the house to the client and if its newer than what the client has, the server will send the whole house piece by piece to the client for caching... And the client will hold only a limited number of houses so exploiting this for individual items will have a very nasty outcome if the items in the game world were individually counted as "houses"...*Edwards wrote:It would be awesome if some new function uo.em are added to commit items around the worlds and not always into multis. If it's possible.
Re: Custom Housing Tool
Rev334 is okey. I only miss a script running when player close the edit gump with mouse right click, because if necessary write some CProps on player on beginning of editing, can't erase later.
Re: Custom Housing Tool
Need a error when DestroyMulti(multi) is called and house.house_editing is true. Also missing a house.cancel_editing (chr).
Something seems weird when click to change between floors, many times is necessary a Sync after this because downstairs just disappear.
Something seems weird when click to change between floors, many times is necessary a Sync after this because downstairs just disappear.
Re: Custom Housing Tool
K thx for the input I hopefully have time this weekend.
Re: Custom Housing Tool
sorry for the delay check rev. 353
Re: Custom Housing Tool
Amazing job Turley, thanks so much.
Hey, if you click on Restore without click on backup first entire house disappear even the foundation.
Last saturday (08/27) we tried use new core (350), but had bad time with it, weird troubles like this happen all the time:
Also, we had a very (a lot) weird invalid packet flood, from someone. All this is inside the file bellow.
Full pol.log: http://www.4shared.com/file/1kOPttVP/po ... 08-27.html
Yesterday we tried again use new core (252), had a looooot of crashes:
image:
This is just-to-report, i need to make more tests to get usefull information about this issue.
Our 'oficial core' are @334, with this we had only random crashes when players make commit on houses, but is rare.
Hey, if you click on Restore without click on backup first entire house disappear even the foundation.
Last saturday (08/27) we tried use new core (350), but had bad time with it, weird troubles like this happen all the time:
Then we switch to old core and this stoped. Need recompile? i sow no changes in ecompile. I've tried re-uoconvert but had problem with graphic 0x0, seems like new uoconvert does not use any more 0x4000 > items.Assertion Failed: my_multidefs_by_graphic.count( graphic ) != 0, multi\multidef.cpp, line 294
Shutting down due to assertion failure.
Client#22: Exception in message handler 0xd7: Assertion Failed: my_multidefs_by_graphic.count( graphic ) != 0, multi\multidef.cpp, line 294
0000: d7 00 19 03 42 37 55 00 0d 00 00 00 1d cf 00 00 ....B7U. ........
0010: 00 00 01 00 ff ff ff fe 0a ........ ........
Client#22: Exception in i/o thread: Assertion Failed: my_multidefs_by_graphic.count( graphic ) != 0, multi\multidef.cpp, line 294! (checkpoint=4)
Also, we had a very (a lot) weird invalid packet flood, from someone. All this is inside the file bellow.
Full pol.log: http://www.4shared.com/file/1kOPttVP/po ... 08-27.html
Yesterday we tried again use new core (252), had a looooot of crashes:
image:

This is just-to-report, i need to make more tests to get usefull information about this issue.
Our 'oficial core' are @334, with this we had only random crashes when players make commit on houses, but is rare.