Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Conflicting Object Names (https://forums.graalonline.com/forums/showthread.php?t=69467)

Novo 10-17-2006 06:09 AM

Conflicting Object Names
 
PHP Code:


function onCreated()
  {
  
temp.var = this.ani.getSprite(20);
  if ( 
temp.var == 20 )
    echo( 
temp.var SPC "is an object of type" SPC temp.var.objecttype() );
  } 

returns
PHP Code:

20 is an object of type TGraalVar 

To simplify... Because the obj.name is the sprite name (20), it conflicts with the object type (20) named 20. Instead of returning an TGraalAniSprite, it returns TGraalVar.

This DOES work, however:
PHP Code:

this.ani.getsprite20 ).objecttype(); 

meaning as long as you don't save the object as a variable, you could use it without conflict.

Admins 10-17-2006 01:12 PM

Ok fixed it in my version. It is now saying it is an object (so assigning to another variable works fine), but is still printing the sprite number when you print just the sprite object


All times are GMT +2. The time now is 09:10 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.