incompatible types?

Non-platform specific questions.

incompatible types?

Postby asmodeus » Tue Feb 05, 2008 4:07 pm

Why doesn't this work?: I create a variable called test_var[5][5]. I write test_var = 0; in the script editor and it tells me "incompatible types". How can I avoid this problem?
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: incompatible types?

Postby makslane » Tue Feb 05, 2008 4:15 pm

Are you trying to change the adrees of the variable test_var to 0.
What you want to do?
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: incompatible types?

Postby asmodeus » Tue Feb 05, 2008 6:02 pm

No, I want to read the value to get a color for the setpen function. (setpen(test_var[...)
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: incompatible types?

Postby makslane » Tue Feb 05, 2008 6:30 pm

Try use:


test_var[0][0] = somevalue;

Or somevalue = test_var[0][0];
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: incompatible types?

Postby asmodeus » Tue Feb 05, 2008 6:37 pm

The problem is, that I want to write a variable name and "+", "-", "/", "*" instead of only a number.
in my game it is [320/2-320*vari+xcount*var] and that in both arrays.
If I use it only in one of them and write a single number in the other array, than it works.
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: incompatible types?

Postby makslane » Tue Feb 05, 2008 7:30 pm

Try this:

Code: Select all
test_var[320/2-320*vari+xcount*var][320/2-320*vari+xcount*var] = somevalue;


Or:

Code: Select all
double index = 320/2-320*vari+xcount*var;
test_var[index][index] = somevalue;
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: incompatible types?

Postby asmodeus » Wed Feb 06, 2008 12:27 pm

first: It doesn't work, yet. :?: :( (view screenshot)
second: I don't want to change the value from the test_var with the arrays, I want to read the value and put the value in another variable.
Attachments
screenshot.png
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: incompatible types?

Postby makslane » Wed Feb 06, 2008 12:34 pm

Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: incompatible types?

Postby asmodeus » Wed Feb 06, 2008 12:42 pm

Thanks! That was the problem, I think. :D
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron