CreateMulti txtcommand

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

CreateMulti txtcommand

Post by ghibli1983 »

Hi everybody,
I'm trying to create a command (.createmulti), the code is this here:

Code: Select all

use uo;

program textcommand_createmulti(who, text)
	if(!text)
	 SendSysMessage(who, "Usage is .createmulti [serial].");
	 return;
	endif
	while (1)
	 SendSysMessage(who, "Where do you want to build?");
	 var tgt := TargetMultiPlacement( who, CInt(text) );
	 SendSysMessage(who, "" + tgt);
	 var x := CInt(tgt.x);
	 var y := CInt(tgt.y);
	 var z := CInt(tgt.z);
	 if(!tgt)
	  SendSysMessage(who, "Cancelled.");
	  return;
	 endif	 
	 CreateMultiAtLocation( x, y, z, CInt(text));
	endwhile
endprogram
when I try it in game inserting a code of my multi for example "0x19" comes out this error message
Error Message
Error Message
errormulti.PNG (15.47 KiB) Viewed 7682 times
where is the error?

I thank everyone for their help
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: CreateMulti txtcommand

Post by Yukiko »

According to the docs CreateMultiAtLocation requires the ObjType or the Name member for the multi not the multi ID that you find in UO Fiddler.

Here is part of my itemdesc.cfg file in my housing package where I have the various multi houses defined:

Code: Select all

House    0x16060
{
    Name             smallstoneandplasterhouse
    Graphic          0x4064
    MultiID          0x64
}

House    0x16061
{
    Name             smallstonehouse
    WalkOnScript     houseBanning
    Graphic          0x4066
    MultiID          0x66
}

House    0x16073
{
    Name             smallbrickhouse
    WalkOnScript     houseBanning
    Graphic          0x4068
    MultiID          0x68
}

House    0x16062
{
    Name             smallwoodenhouse
    WalkOnScript     houseBanning
    Graphic          0x406a
    MultiID          0x6a
}

So to create the smallbrickhouse using your script I would enter 0x16073 not the MultiID of 0x68. If you perform a test in your script on the text parameter and allow either strings or integers you could also pass smallbrickhouse to CreateMultiAtLocation to create the multi.

I hope that helps.
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

Thank you Yukiko,

i understand the problem now, but i have another question,

I created with UOA more building and i import the UOA File in UO Fiddler

when read a grafic HEX?

Exemple:

Code: Select all

House 0x607A  <------HEX CALLING IN GAME
{ 
    Name             twostoryvilla 
    WalkOnScript     houseBanning  
    Graphic          0x409E  <------- ???? 
    MultiID          0x9E <------ OK! I UNDERSTAND IS A MULTI HEX
} 
Thank's for the important tips !!!

Bye
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: CreateMulti txtcommand

Post by Turley »

The graphic entry for houses/boats is no more needed since pol099. So just define the multiid as you added it via fiddler and choose a free object type.
(P.s. you can also create multis via fiddler, no need to use uoa ;) )
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

Thankyou Turley,

i'm have a POL95 ,
usually used a OSI House , now i create varius House for add in my Vendor Architect.
Before Chenge my DeedScript i need to try a build from a multicommand text.

But now , where discovery the Graphic ID for my new building?
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: CreateMulti txtcommand

Post by Turley »

Then you should really update.
If I remember correctly just use the same graphic as your choosen objtype.
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

Thank you, now try to add this line!
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

OK i add all in the ItemInfo.cfg in my System/Housing pkg, and add a new house in my multis.cfg,

When call in game a new house is all ok, i'm see the new building in transparency, move my target on a free areas (example: green acres), but ....not build :shame: :deadhorse: ,
when click with my target

See the image below:
NO BUILD
NO BUILD
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: CreateMulti txtcommand

Post by Turley »

Use a print around your createmultiatlocation function and check your console why it fails.
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

E see the error , but i tgt a house in a open space area (green acres)

attach the image below:
errore_multi.PNG
errore_multi.PNG (10.08 KiB) Viewed 7654 times
User avatar
ghibli1983
New User
Posts: 27
Joined: Mon Apr 23, 2018 1:36 pm
Location: Italy
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 »

I have a update for the createmulti problem,

house compare in strasparance but no build,
in the console not compare an error, but compare a build message,
but the house not compare in game
console createmulti
console createmulti
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: CreateMulti txtcommand

Post by Yukiko »

What I recommend is setting up a test server with POL 099.1 and the Distro.Add your custom building to the Distro housing package and use your modified client to log in and attempt to place your house in a that test server. If it works then it is an issue with the obsolete Core you are using. Though POL 095 was a great version of POL it is no longer supported.

I truly do not like being the bearer of difficult news but you should be using a current Core.

Maybe Turley or another developer will know if this is an issue with POL 095 or maybe some problem with your script.
Post Reply