Is there any way to...
Moderator: POL Developer
Is there any way to...
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?
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);
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?
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?
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.
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.
No, ALL is binary OR of MULTIS, OBJECTS, and WORLDZ. You can combine them yourself if you like.. for examplePoi wrote:If all does all of them, does world do objects and multis? and objects to multi's?
Code: Select all
flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;
No. If you would do something likeCWO wrote:isn't that supposed to beflags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;
flags := CRMULTI_IGNORE_MULTIS + CRMULTI_IGNORE_WORLDZ;
Code: Select all
flags := CRMULTI_IGNORE_MULTIS;
...
flags := flags | CRMULTI_IGNORE_ALL;
...
In this special case, because in binary each flag is its own bit:
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:
So, in short, when combining flags, ALWAYS ALWAYS use the OR operator, and not the addition operator.
Code: Select all
CRMULTI_IGNORE_MULTIS = 0001
CRMULTI_IGNORE_OBJECTS = 0010
CRMULTI_IGNORE_WORLDZ = 0100
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)