Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Graal Main Forum (English) (https://forums.graalonline.com/forums/forumdisplay.php?f=4)
-   -   New Graal version: 5.11 (https://forums.graalonline.com/forums/showthread.php?t=77049)

Angel_Light 10-09-2007 01:53 PM

Quote:

Originally Posted by Skyld (Post 1351937)
I do not see why images should be any different.

Maybe because they all already exist just have no values to them and there all set to null until we modify them with findImg()

Skyld 10-09-2007 02:01 PM

Quote:

Originally Posted by Angel_Light (Post 1351942)
Maybe because they all already exist just have no values to them and there all set to null until we modify them with findImg()

If they are set to null then they do not exist. Imagine how much memory it would waste to have all the possible image indexes already associated with an image object in memory.

Inverness 10-09-2007 10:37 PM

Stefan said himself that findimg() is creating a new image when one isn't found. showimg() may be shorter but its not clearer to anyone new to GScript.
Quote:

Originally Posted by Skyld
and I do not see why images should be any different.

You're not serious are you? The functions are similar in the fact that they find objects however those objects are used in very different ways. findimg() creates an image when one isn't found for ease of use when manipulating indexed images.

Skyld 10-09-2007 11:11 PM

Quote:

Originally Posted by Inverness (Post 1352001)
Stefan said himself that findimg() is creating a new image when one isn't found.

I'm fully aware of that.
Quote:

Originally Posted by Inverness
showimg() may be shorter but its not clearer to anyone new to GScript.

In my experience, people learning gscript find showimg() easier to understand than jumping straight into with (findimg()). That's because the other similar functions (findplayerbycommunityname, findnpc, findweapon, etc) do not instantiate anything when called. They expect the object to already exist.
Quote:

Originally Posted by Inverness
You're not serious are you? The functions are similar in the fact that they find objects however those objects are used in very different ways. findimg() creates an image when one isn't found for ease of use when manipulating indexed images.

I am not sure how they are used in different ways. All it is doing is providing an object to work with. In your example, it's taking the object and bringing it into the current scope to change a few variables. In my opinion, it should be assumed that the object already exists, because I believe that scripting languages should be semantically consistent.

Angel_Light 10-09-2007 11:33 PM

Quote:

Originally Posted by Skyld (Post 1351944)
If they are set to null then they do not exist. Imagine how much memory it would waste to have all the possible image indexes already associated with an image object in memory.

exactly, if something is null (in computers) it does not exist. Guess I kinda worded that wrong.

DeathOfRa 10-14-2007 04:19 AM

May I say something? Stefen, I can't change my font size anymore... Whats up? Its like bulky now :frown:


All times are GMT +2. The time now is 04:41 PM.

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