Variable already defined?... __Plugin100.ash -SOLVED- :)

Started by Grim, Wed 06/04/2016 10:59:41

Previous topic - Next topic

Grim

Please help!

I've been experimenting with the joystick plugin: http://www.adventuregamestudio.co.uk/forums/index.php?topic=41658.0. I've added it to my game and now I keep getting this error:

Failed to save room room6.crm; details below
__Plugin100.ash(51): Error (line 51): 'IsButtonDown' is already defined

The problem is, I don't have IsButtonPressed defined anywhere! What's _Plugin100 anyway? I can't find it. I've actually deleted all scripts and rooms hoping it was hidden in there somewhere and this error still shows up...

Any ideas, folks?...

Danvzare

You could always go into the actual game folder and delete the file __Plugin100.ash manually.

Grim

Quote from: Danvzare on Wed 06/04/2016 11:10:59
You could always go into the actual game folder and delete the file __Plugin100.ash manually.

It's not there.

Gurok

"__Plugin###.ash" are auto-generated script headers that AGS creates for plugins. Try rebuilding all files?
[img]http://7d4iqnx.gif;rWRLUuw.gi

Grim

Quote from: Gurok on Wed 06/04/2016 11:15:28
"__Plugin###.ash" are auto-generated script headers that AGS creates for plugins. Try rebuilding all files?

I tried rebuilding several times. With the joystick plugin switched off, it rebuilds fine. With joystick on, it fails to rebuild, because of the error...

Wyz

Hmm I checked and this seems to be a problem of recent AGS versions. There is another struct that has the same function but those should not clash.  Hmm I guess I'm going to write a bug report on this. Which AGS version are you using?
Life is like an adventure without the pixel hunts.

Grim

Quote from: Wyz on Wed 06/04/2016 12:45:38
Hmm I checked and this seems to be a problem of recent AGS versions. There is another struct that has the same function but those should not clash.  Hmm I guess I'm going to write a bug report on this. Which AGS version are you using?

Version 3.3.0.

Crimson Wizard

#7
Quote from: Grim on Wed 06/04/2016 12:53:30
Version 3.3.0.

This is very strange BTW, because I used joystick plugin many times with this version (and following updates).
I will try again.


E:I have made a simple game with joystick plugin, and it compiles fine in 3.3.0 - 3.3.5 and 3.4.0.6.

We would need an example of script (like the room that could not save) that causes this error.

Are you using other plugins, or script modules?

Crimson Wizard

#8
Okay, I found WHEN it happens.

You need to have "Enforce object-oriented scripting" set to FALSE to make this error appear.

The conflict involves the global IsButtonDown function (which was obsolete since around AGS 2.72).

This error was in AGS for a very long time. If you have a function in global namespace, you cannot have struct function of same name.
The solution is to turn "Enforce object-oriented scripting" to TRUE (you might need to fix your scripts after that if you kept using obsolete functions).
We already had an issue in tracker about this: http://www.adventuregamestudio.co.uk/forums/index.php?issue=361.0

Grim

Dude, you're awesome! :) :) That's totally what it was!!! :)

Now... I just have to figure out how to set up the scripts so it would work ;) But the stupid error is gone! Finally!!! :)

SMF spam blocked by CleanTalk