CreateMulti txtcommand

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

Moderator: POL Developer

Post Reply
ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

CreateMulti txtcommand

Post by ghibli1983 » Sat May 12, 2018 11:19 am

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
errormulti.PNG
Error Message
errormulti.PNG (15.47 KiB) Viewed 128 times
where is the error?

I thank everyone for their help

Yukiko
Distro Developer
Posts: 2391
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: CreateMulti txtcommand

Post by Yukiko » Sat May 12, 2018 6:57 pm

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.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Sun May 13, 2018 3:21 am

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: 644
Joined: Sun Feb 05, 2006 4:45 am

Re: CreateMulti txtcommand

Post by Turley » Sun May 13, 2018 5:34 am

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 ;) )

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Sun May 13, 2018 5:40 am

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: 644
Joined: Sun Feb 05, 2006 4:45 am

Re: CreateMulti txtcommand

Post by Turley » Sun May 13, 2018 7:10 am

Then you should really update.
If I remember correctly just use the same graphic as your choosen objtype.

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Sun May 13, 2018 7:33 am

Thank you, now try to add this line!

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Sun May 13, 2018 7:55 am

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:
nobuold_forum.png
NO BUILD

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

Re: CreateMulti txtcommand

Post by Turley » Sun May 13, 2018 9:26 am

Use a print around your createmultiatlocation function and check your console why it fails.

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Sun May 13, 2018 11:04 am

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 100 times

ghibli1983
New User
Posts: 9
Joined: Mon Apr 23, 2018 1:36 pm
Contact:

Re: CreateMulti txtcommand

Post by ghibli1983 » Mon May 14, 2018 1:46 pm

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
multi_termina.PNG
console createmulti

Yukiko
Distro Developer
Posts: 2391
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: CreateMulti txtcommand

Post by Yukiko » Mon May 14, 2018 4:48 pm

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.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply