PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
bug in parameters?

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097
Display posts from previous:   

Author Message
zandor70



Joined: 10 Feb 2006
Posts: 79
Location: Italy

PostPosted: Thu Apr 19, 2007 8:01 pm    Post subject: bug in parameters? Reply with quote

I have a very strange problem:

I have a script:
Code:

     loc := TargetCoordinates(who);
      print("x trasmitted="+loc.x); //DEBUG
      npc := CreateNpcTemplate(template, loc.x, loc.y, loc.z, who.realm, Struct { "facing" := who.facing } );


And a function:
Code:

function CreateNpcTemplate(template, x, y, z, realm := _DEFAULT_REALM, props := 0, cprops := 0)
  print("x received="+x); //DEBUG


I have tryed to change name function.

Now this is strange error shown from output of the 2 print:
Code:

x trasmitted=5576
x received=struct{ objtype = 0, realm = "britannia", x = 5576, y = 1253, z = 0 }


It is a VERY strange problem... I pass Cint, loc.x but function receive entire loc struct.... why? How is this possibile?

I have tryed to read also template, y, z and the other parameters... error is only on x parameter....

Only if I use as function:
Code:

function CreateNpcTemplate(template, x, y, z, realm := _DEFAULT_REALM, props := 0, cprops := 0)
  if (x.x)
    x := x.x;
  endif
  print("x received="+x); //DEBUG

then "x_received" is ok....

I have tryed with polcore 097 RC2 RC2.1 and RC3

I have done this try:
Modified function:
Code:

function CreateNpcTemplate(template, temp, x, y, z, realm := _DEFAULT_REALM, props := 0, cprops := 0)
  print("temp received="+temp); //DEBUG
  print("x received="+x); //DEBUG


And function:
Code:

     loc := TargetCoordinates(who);
      //print("x trasmitted="+loc.x); //DEBUG
      npc := CreateNpcTemplate(template, loc.x, loc.x, loc.y, loc.z, who.realm, Struct { "facing" := who.facing } );


And now print() output is:
Code:

temp received=struct{ objtype = 0, realm = "britannia", x = 5576, y = 1250, z =
0 }
x received=5576


so it is not a x member TargetCoordinates() related problem, but it seem a problem in a specific number of parameter:
the second parameter always report enture struct: first parameter see loc.x like "loc", while second parameter see "loc.x" like "loc.x"

Now I have tryed:
Code:

function CreateNpcTemplate(x, template, y, z, realm := _DEFAULT_REALM, props := 0, cprops := 0)
  print("x received="+x); //DEBUG

     loc := TargetCoordinates(who);
      print("x trasmitted="+loc.x); //DEBUG
      npc := CreateNpcTemplate(loc.x, template, loc.y, loc.z, who.realm, Struct { "facing" := who.facing } );


And print report is now:
Code:

x trasmitted=5575
x received=<uninitialized object>


Please reply me why I an thinking to be crazy....

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Sat Apr 21, 2007 8:25 am    Post subject: Reply with quote

First off, calling line builds the struct incorrectly. Look into fixing that first and see if it still does it.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty