Is there any way to...

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 096.
Note: Core 096 is no longer officially supported.

Moderator: POL Developer

Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Is there any way to...

Post by Poi » Mon Jul 07, 2008 3:39 pm

I want for staff to be able to place houses over things such as rocks and little flowery things, is there any way I can do this?

User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post by ncrsn » Mon Jul 07, 2008 5:59 pm

Use the different flags to make it possible (CRMULTI_IGNORE_OBJECTS): http://docs.polserver.com/pol097/single ... AtLocation.

Code: Select all

const STAFFLEVEL := 2;

var flags := 0;

if (who.cmdlevel > STAFFLEVEL)
    flags := CRMULTI_IGNOREALL;
endif

var multi := CreateMultiAtLocation(targ.x, targ.y, targ.z, multitype, flags, targ.realm);

Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi » Mon Jul 07, 2008 7:05 pm

ok, got it to work, thanks.

One question though...

so, with
const CRMULTI_IGNORE_MULTIS := 0x0001; //ignore intersecting multis
const CRMULTI_IGNORE_OBJECTS := 0x0002; //ignore dynamic objects
const CRMULTI_IGNORE_WORLDZ := 0x0004; //ignore standability,relative Z,world height
const CRMULTI_IGNORE_ALL := 0x0007;


If all does all of them, does world do objects and multis? and objects to multi's?

User avatar
CWO
POL Expert
Posts: 1131
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA
Contact:

Post by CWO » Mon Jul 07, 2008 9:34 pm

CRMULTI_IGNORE_MULTIS - Ignores other houses and multis so you can essentially place 2 within eachother.

CRMULTI_IGNORE_OBJECTS - Ignores items and characters in a spot and places the multi anyway.

CRMULTI_IGNORE_WORLDZ - Ignores uneven terrain, rocks, flowers, and the world height.

and of course CRMULTI_IGNORE_ALL does all of them.

User avatar
oenone
New User
Posts: 6
Joined: Wed Feb 01, 2006 3:25 am
Location: Mannheim, Germany
Contact:

Post by oenone » Wed Jul 09, 2008 2:21 pm

Poi wrote:If all does all of them, does world do objects and multis? and objects to multi's?
No, ALL is binary OR of MULTIS, OBJECTS, and WORLDZ. You can combine them yourself if you like.. for example

Code: Select all

flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;

User avatar
CWO
POL Expert
Posts: 1131
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA
Contact:

Post by CWO » Fri Jul 11, 2008 2:17 am

flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;
isn't that supposed to be
flags := CRMULTI_IGNORE_MULTIS + CRMULTI_IGNORE_WORLDZ;

User avatar
oenone
New User
Posts: 6
Joined: Wed Feb 01, 2006 3:25 am
Location: Mannheim, Germany
Contact:

Post by oenone » Fri Jul 11, 2008 3:44 am

CWO wrote:
flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;
isn't that supposed to be
flags := CRMULTI_IGNORE_MULTIS + CRMULTI_IGNORE_WORLDZ;
No. If you would do something like

Code: Select all

flags := CRMULTI_IGNORE_MULTIS;
...
flags := flags | CRMULTI_IGNORE_ALL;
...
it would be wrong if you used +. if you use flags, always use binary OR (or AND, depending on what you're trying to do.

Luth
Grandmaster Poster
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am
Contact:

Post by Luth » Fri Jul 11, 2008 2:28 pm

In this special case, because in binary each flag is its own bit:

Code: Select all

CRMULTI_IGNORE_MULTIS  = 0001
CRMULTI_IGNORE_OBJECTS = 0010
CRMULTI_IGNORE_WORLDZ  = 0100
using a binary OR ( | ) or using normal addition ( + ) will result in the same value.
1 | 2 = 3
0001 | 0010 = 0011

-and-

1+2=3
0001 + 0010 = 0011

However, because these are flags, only the binary OR operation is acceptable, and addition can lead to errors. eg:

Code: Select all

(CRMULTI_IGNORE_ALL + CRMULTI_IGNORE_MULTIS) != (CRMULTI_IGNORE_ALL | CRMULTI_IGNORE_MULTIS)
0111 + 0001 = 1000 (8)
0111 | 0001 = 0111 (7)
So, in short, when combining flags, ALWAYS ALWAYS use the OR operator, and not the addition operator.

Post Reply