Page 1 of 1

Unclear Error Message

Posted: Sun Feb 04, 2007 8:53 am
by overclocked
Hi,

Another thing found when doing "strange things" was a error message that I think shouldn't be shown. Follow the description below to get it..

1) Start the About-example
2) Add the code:
CurrentModel.Material.Color = 12345;
to the OnSpawn.ZExpression

The error message I get is:
"Unknown iname Color (d:\Data\Delphi32\ZzDC\tools\ZDesigner\ExprEdit.pas, line 68)

I'll keep hacking and keep reporting.

Posted: Sun Feb 04, 2007 11:23 am
by VilleK
It can't be easy writing expressions when there are not yet any documentation, this is a high priority for me!

When you assign values to a color, you must assign the red, blue, green, and alpha values seperately, like this:

Code: Select all

MyMaterial.Color.R = 0.5; 
The range is 0.0 to 1.0.

Next, there is not yet support for accessing objects through their parents.

So instead of writing:
CurrentModel.Material.Color = 12345;

You must give the Material a name like "PlayerMaterial", and write:

Code: Select all

PlayerMaterial.Color.R = 0.5; 
Another way of changing the color is to use a RenderSetColor command, give it a name (playercolor), and write:

Code: Select all

PlayerColor.Color.R = 0.5;

Posted: Sun Feb 04, 2007 4:00 pm
by overclocked
:-) Thanks for that walkthrough, I'll try it again. Quite an achiement of me to be able to f***k 3 things up in a single row! At least it showed that the error handling of the Gameditor-framework has some... holes. I'll get on it again then!

Posted: Mon Feb 05, 2007 8:13 am
by VilleK
Yep, that error message you got wasn't very informative :)
I'll put it on my todo-list.

Also check out the new help topic: Writing expressions.