function 'Character::FaceDirection' is already defined?

Started by Elvisish, Fri 10/02/2017 17:45:29

Previous topic - Next topic

Elvisish

I tried to load an old game test in the new editor, and I got this error. I tried turning off object oriented scripting, but it still failed. Does anyone have any suggestions what is causing this? Thanks! :P

Crimson Wizard

#1
Quote from: Elvisish on Fri 10/02/2017 17:45:29
I tried to load an old game test in the new editor, and I got this error. I tried turning off object oriented scripting, but it still failed. Does anyone have any suggestions what is causing this? Thanks! :P

There was FaceDirection defined in old templates, but now that function is defined in the AGS itself. I suspect this is old 9-verb template, because it had one.

There are two possible solutions:
1) If you are not going to use new script functions, you may set ScriptAPIVersion in the General settings to 3.2.1.
2) If you want new script functions, you need to find and remove FaceDirection from your scripts, and use built-in one instead.

You may do solution 1 first if you want to quickly compile and run your game, and later switch to solution 2, if you are going to develop this project further.

Elvisish

Quote from: Crimson Wizard on Fri 10/02/2017 17:50:14
Quote from: Elvisish on Fri 10/02/2017 17:45:29
I tried to load an old game test in the new editor, and I got this error. I tried turning off object oriented scripting, but it still failed. Does anyone have any suggestions what is causing this? Thanks! :P

There was FaceDirection defined in old templates, but now that function is defined in the AGS itself. I suspect this is old 9-verb template, because it had one.

There are two possible solutions:
1) If you are not going to use new script functions, you may set ScriptAPIVersion in the General settings to 3.2.1.
2) If you want new script functions, you need to find and remove FaceDirection from your scripts, and use built-in one instead.

You may do solution 1 first if you want to quickly compile and run your game, and later switch to solution 2, if you are going to develop this project further.
Thanks, the first one worked! I'm sooooo beginner with AGS, I first started playing with it in about 2000/2001, and have come and gone over the years. I asked back in about 2005 for an adlib music emulator. A year or two ago, someone honored my 10-year anniversary bump of the topic by writing it for me! But I'm still awful with AGS, I can handle Fusion and Construct's visual editors and php/html/css, but scripting games still scares me!

So, shall I just delete the lines with FaceDirection and try and replace it with whatever built-in function there is? What are the new script features since 3.2.1 that might be useful for a lucasarts-style game?

Sorry if I've blabbed on too much! :D

Crimson Wizard

#3
Quote from: Elvisish on Fri 10/02/2017 19:02:40
So, shall I just delete the lines with FaceDirection and try and replace it with whatever built-in function there is? What are the new script features since 3.2.1 that might be useful for a lucasarts-style game?

No, you need to find FUNCTION FaceDirection inside one of the scripts in your game, and remove it. You also need to remove its declaration from one of the script headers.

For the list of changes, you may check Docs/Changes.txt where you installed AGS Editor, but I cannot tell which will be useful for you.

SMF spam blocked by CleanTalk