SOLVED: Confusion about backward compatibility

Started by Rocco, Wed 27/07/2011 10:40:40

Previous topic - Next topic

Rocco

I encounterd a strange behavior, which i dont understand:

I did a little game a while back and i opened it with AGS 3.2.1.111
It works fine without errors, all is good.

Now I'm working on another game, with the same AGS Version (3.2.1.111)
I imported a module from the game above and got errors.

***t.asc(106): Error (line 106): Undefined token 'AnimateCharacterEx'
***t.asc(106): Error (line 106): Undefined token 'RawSetColor'

So, these old commands work inside AGS 3.2.1.111 in one game,
but produce errors in another game using the same AGS Version.

What is going on here?


monkey0506

If old-style commands are working in one game but not the other it's because of the setting "Enforce object-based scripting" in your General Settings pane. It has to be set to false for those commands to work. But, why are you using them?? If your project is being built entirely in AGS 2.7+ then I don't see any reason for the legacy commands.

Rocco

#2
ahhthanks,
well the module is older then 2.7
I tried to modernize it with actual functions,
but its an action module and the main goal is, that the control with keyboard input feels good and the char
reacts in a good way, which is the case with the old commands.  
i play a bit around with old and new commands and realized that
AnimateCharacterEx doesnt work the same as player.animate.
It allows better finecontrol while moving the char (at least in my particular case)
so i leave the script original as it works the best way.

Khris

I'm curious, what's the difference between those two?
Looking at them in the helpfiles, they seem to have the exact same parameters and do the exact same thing.

Rocco

generally yes, but when i move the player while pressing the key
the animation behavior is not exactly the same, especially when releasing the key.

i'll give it another try, but in the first run, the gameplay doesnt feel so natural as before.
here is a little demo -> demo

use numpad for player control



monkey0506

Quote from: Rocco on Wed 27/07/2011 11:26:04well the module is older then 2.7

Just to be entirely clear, there's absolutely no way the module is older than 2.7 because script modules didn't exist until AGS 2.7 Beta 13. You might have copied code from an older AGS global script, but the module itself isn't from a pre-2.7 version. :P

In any case, I don't see what the demo is supposed to be showing. Is this supposed to be the version using the old-style scripting or the object-based scripting? You didn't specify.

There shouldn't be any difference between the two calls so long as you pass in the same parameters.

Rocco

yes your right, the code is actually older then 2.7, but i made a module of it under 2.72 and import it to 3.xx.
the demo is with old code, and works as it should.

I got the biggest problems not with the animate command but with the
player.WalkStraight which doesn't act the same as MoveCharacterDirect with the same parameters.

With player.WalkStraight i didnt get the same behavior, the char walks to long when realeasing the button,
and if i decrease the minimum walk length, he stucks every few pixels no matter if you are pressing the key or not and you have to release and press the key again, i want it the same way as it is in the demo above,
while you are pressing the button the char walks and when you release the button the char stops immediatly,
what isnt the case with the "new" commands.

But i'll work on an code upgrade on weekend (we will see.  :P),
and hopefully i can sort this problem out and enhance the whole module with AGS3.xx and more flexibility.


SMF spam blocked by CleanTalk