Help: Variable 'oObject' already imported?

Started by Ayato, Sat 31/05/2008 08:48:29

Previous topic - Next topic

Ayato

A friend and I have been reading through the AGS 3.0 tutorials, but weve run across an error when attempting to creat an animating room object.
The error is as follows:
Error (line 2): Variable 'oObject' is already imported

Weve set up the views and the loops, but we cant find the exact problem. Any suggestions?

Khris

Could you post the surrounding lines of the room script?
My guess is you didn't put the .Animate command inside the before_fadein event's function but directly into the room script.

Ayato

Quote from: KhrisMUC on Sat 31/05/2008 10:53:11
Could you post the surrounding lines of the room script?

We had to delete our code because we weren't able to save our progress. It was only two skimpy lines of code, the oObject.setview and oObject.animate functions. I remember the error referred to the line in which we put the .setview.

And yes, we put the commands inside the Room Script. We've found the before_fadein events in our first room, and we'll try writing the commands there. Thanks for the help!

I think our main problem is a lack of functional examples of these kinds of code instances. The tutorial does a good job of explaining WHAT the commands do, but doesn't give it context very well... at least not to us. We weren't able to find where these commands belonged even after consulting the tutorial and index for hours.

Khris

Well, every command has to go inside a function, otherwise how could AGS determine when to call what?
Basically, the room scripts and the global script are a collection of instructions to be executed after certain events occur, them being caused either by the player (e.g. look at xy) or the game logic (e.g. repeatedly_execute).

Dualnames

Well, I'd wild guess you have two objects called oObject. Try calling that object this way and if it works I'm right.

object[object id number between braces].Animate..ecc
ex:

object[0].Animate(0,5,eBlock,eOnce,eForwards);
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk