Unclear Error Message

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
overclocked
Posts: 4
Joined: Fri Feb 02, 2007 5:24 pm

Unclear Error Message

Post 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.
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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;
overclocked
Posts: 4
Joined: Fri Feb 02, 2007 5:24 pm

Post 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!
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
Post Reply