PenUltima Online

It is currently Sat Oct 11, 2008 10:33 pm

All times are UTC - 8 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Logical placement for realm parameter
PostPosted: Tue Sep 12, 2006 1:44 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
I know I am going to kick myself for suggesting this but because I believe in consistency I will anyway.

Maybe not for POL 97 but in some future release I believe that the position of the realm parameter within the "upgraded" function calls should be placed in a more logical location.

I will give the example below to show what I mean.

CreateItemAtLocation( x, y, z, objtype, amount := 1, realm := _DEFAULT_REALM )

To be logical should be defined as
CreateItemAtLocation( x, y, z, realm := _DEFAULT_REALM, objtype, amount := 1 ) as it is in the MoveObjectToLocation function.

I understand why it is the way it is but it's more logical ro have it positioned with the XYZ coords.

Yeah, I know I am the one always griping about change but this is one of those times when logic outweighs my complaints. Besides I keep having to remember to put the realm info at the end of those function calls.
:)

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 5:23 am 
Offline

Joined: Fri Feb 17, 2006 12:25 pm
Posts: 76
Realm is an optional parameter (since there is a meaningful default
value for it). It doesn't make sense to place it before mandatory
parameters like objtype, which can't have a meaningful default
value.

Xandros


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 10:29 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
Actually realm is not optional. By the very definition that there is a default makes it clear that it is required. It's just that the developers were kind enough to define a default for us in the em file. If they had not done that then we would have been required to include our own parameter for realm.

If you look at the truly POL 96 unique function, MoveObjectToLocation you'll see the logical placement of the realm parameter. It is placed in this function following the XYZ parameters because this function was created as a brand new function for POL 96 and it is the logical place for it because it is part of an objects location within the "world".

MoveObjectToLocation( object, x, y, z, realm := _DEFAULT_REALM, flags := MOVEOBJECT_NORMAL )

Whereas for all the "upgraded" functions the realm parameter was tacked on the end for compatibility.

By placing it following the Z parameter you do not need to add the flag parameters in other functions.

Example:
Let's say you have this function in a script
ListMobilesNearLocationEx( x, y, z, range, flags, realm := _DEFAULT_REALM )

Now let's say you don't want to use any flags. As it currently stands you have to enter a 0 in the function call where the flags are supposed to be.
ListMobilesNearLocationEx( x, y, z, range, 0, realm)

Here is the logical placement of realm in that function call:
ListMobilesNearLocationEx( x, y, z, realm, range, flags)

So if the realm parameter is moved just following the X parameter you could just ignore the flag parameter if you were not going to use any special flags. This would cut down on a lot of mistakes in scripts. I am sure that many of you have forgotten to throw in that 0 for no flags in those function calls where the realm parameter follows the flag parameter.

Anyway, that's my thinking on the subject.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:41 am 
Offline

Joined: Fri Feb 17, 2006 12:25 pm
Posts: 76
Yukiko wrote:
Actually realm is not optional. By the very definition that there is a default makes it clear that it is required. It's just that the developers were kind enough to define a default for us in the em file. If they had not done that then we would have been required to include our own parameter for realm.


And because we're not required to include it, it makes sense the way
it is right now.

Yukiko wrote:
If you look at the truly POL 96 unique function, MoveObjectToLocation you'll see the logical placement of the realm parameter. It is placed in this function following the XYZ parameters because this function was created as a brand new function for POL 96 and it is the logical place for it because it is part of an objects location within the "world".

MoveObjectToLocation( object, x, y, z, realm := _DEFAULT_REALM, flags := MOVEOBJECT_NORMAL )


MoveObjectToLocation can look this this because there is a meaningful
default value for the flags parameter. Thats the difference between the
two, not the fact that one of them was introduced earlier than the
other.

Xandros


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 10:09 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
My original arguement still stands: The realm parameter is not placed logically in the "upgraded" commands. It is in MoveObjectToLocation. This is an inconsistency in the syntax of eScript. One does not want inconsistencies in the definitions of functions. That can lead to confusion and errors. It is not logical. As anyone knows programming (scripting) is based on logic.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 14, 2006 1:45 am 
Offline

Joined: Fri Feb 17, 2006 12:25 pm
Posts: 76
Yukiko wrote:
As anyone knows programming (scripting) is based on logic.


The reason to keep those functions as they are is perfectly logical.
It makes scripting easier for everyone who is not using the additional
realms. If you don't like it, I can understand that. But don't get started
with logic in such a question.

Xandros


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 14, 2006 10:24 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
I understand those who are scripting with one map will not understand my reason for this request and like I said maybe this isn't for POL 97. For those of us scripting for multiple maps the placement is more logical than the way it is now. It's obvious that had realms been around from day one the realm parameter would have been right zfter the Z parameter as it is with MoveObjectToRealm. Otherwise the developers would have placed realm after the MOVEOBJECT flags in that function as they did in the "upgraded" functions.

I think I have made my point, stated it as succinctly as possible and there is nothing more I need say.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 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