3 registered members (AndrewAMD, VoroneTZ, dpn),
1,346
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
"temp" undeclared identifier
#368948
04/29/11 19:53
04/29/11 19:53
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Hi, I´m currently translating my old A7 .wdl scripts to the new Lite-C for A8. I´m being able to update most of my .wdl code to Lite-C so far, but bumped into a tricky one now:
if(event_type == EVENT_SCAN)
{
...
vec_set (temp.x, my .x);
vec_to_screen (temp.x, camera_1);
...
it´s generating the following error message: ERROR in items.c, line 181: 'temp' undeclared identifier" < vec_set (temp.x, my .x); > Way tricky to find the replacement syntax, because the code in the examples is the same i´m using. Is 'temp' replaced by another syntax, or the ´temp´ concept isn´t used anymore in the new codes? Thanks in advance.
|
|
|
Re: "temp" undeclared identifier
[Re: Ericmor]
#368984
04/30/11 09:05
04/30/11 09:05
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Well, that particular error message disappeared when i declared a new ´temp´ var inside the function itself (renamed it to be used especifically on that place only):
...
var tempskill01;
tempskill01=my.skill1;
controlitem[tempskill01]=1;
...
Now i´m have my first trouble with an ACTION function... (still couldn´t find a working ACTION Lite-C structure example). Well, one problem at a time, i guess... thanks again, everybody.
|
|
|
Re: "temp" undeclared identifier
[Re: Pappenheimer]
#369009
04/30/11 15:24
04/30/11 15:24
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
"temp = my.skill1" doesn't work in lite-c, it's a lot less forgiving than c-script. you need.
vec_set(temp.x,my.skill1);
I had a problem going from c-script to lite-c as well but it's worth it as it is so much more powerful. I love being able to pass near limitless parameters. Saved hundreds of lines of code because of that.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: "temp" undeclared identifier
[Re: Ericmor]
#369016
04/30/11 17:34
04/30/11 17:34
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
...
var tempskill01;
tempskill01=my.skill1;
controlitem[tempskill01]=1;
...
You know that this piece of code is pointless and can be replaced by the line "controlitem[my.skill1]=1;" ?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|