It is currently Fri Nov 21, 2008 9:43 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Is there any way to...
PostPosted: Mon Jul 07, 2008 3:39 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 5:59 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 225
Use the different flags to make it possible (CRMULTI_IGNORE_OBJECTS): http://docs.polserver.com/pol097/singlefunc.php?funcname=CreateMultiAtLocation&xmlfile=uoem.xml#CreateMultiAtLocation.

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 7:05 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 9:34 pm 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 794
Location: Chicago, IL USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 09, 2008 2:21 pm 
Offline
User avatar

Joined: Wed Feb 01, 2006 3:25 am
Posts: 6
Location: Mannheim, Germany
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:
flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 2:17 am 
Offline
Certified POL Expert
User avatar

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 794
Location: Chicago, IL USA
Quote:
flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;


isn't that supposed to be

Quote:
flags := CRMULTI_IGNORE_MULTIS + CRMULTI_IGNORE_WORLDZ;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 3:44 am 
Offline
User avatar

Joined: Wed Feb 01, 2006 3:25 am
Posts: 6
Location: Mannheim, Germany
CWO wrote:
Quote:
flags := CRMULTI_IGNORE_MULTIS | CRMULTI_IGNORE_WORLDZ;


isn't that supposed to be

Quote:
flags := CRMULTI_IGNORE_MULTIS + CRMULTI_IGNORE_WORLDZ;

No. If you would do something like
Code:
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 2:28 pm 
Offline
POL Developer

Joined: Mon Jan 30, 2006 8:10 am
Posts: 147
In this special case, because in binary each flag is its own bit:
Code:
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:
(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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl