adventuregamestudio / ags-manual

AGS documentation.
https://adventuregamestudio.github.io/ags-manual/
MIT License
26 stars 9 forks source link

Track obsolete API in the script examples #216

Open ivan-mogilko opened 1 year ago

ivan-mogilko commented 1 year ago

There seem to be leftovers of obsolete, sometimes quite ancient API in the script examples. I'm afraid it might be tedious to look for them all manually.

Would it be realistic to make some kind of a script that would have a list of obsolete functions and properties as an input, and run through the wiki pages, and then tell which one still mention these?

Obsolete API table: https://github.com/adventuregamestudio/ags-manual/wiki/ObsoleteScriptAPI

morganwillcock commented 1 year ago

This was generated by ignoring the "Script API", "Upgrading", and the "Obsolete variables" pages, and then looking for matches. I think this is the best I can reasonably do whilst the obsolete functions are actually still documented and linked.

BlockingScripts.md:1786:Character.Say command. Say (or *DisplaySpeech* in old-style scripting)
Replace 'DisplaySpeech' with 'Character.Say'

BlockingScripts.md:1818:ProcessClick to run the appropriate event. When it does so, it finds
Replace 'ProcessClick' with 'Room.ProcessClick'

BlockingScripts.md:1834:calling ProcessClick, so the room script will actually be run on the
Replace 'ProcessClick' with 'Room.ProcessClick'

Constants.md:2009:    // only compile the MoveCharacter command if not using object-based scripting
Replace 'MoveCharacter' with 'Character.Walk'

Constants.md:2010:    MoveCharacter(EGO, 30, 40);
Replace 'MoveCharacter' with 'Character.Walk'

EnginePluginRun-timeAPI.md:4665:#### IAGSEngine.GetPlayerCharacter
Replace 'GetPlayerCharacter' with 'Use `player` pointer'

EnginePluginRun-timeAPI.md:4667:int GetPlayerCharacter ();
Replace 'GetPlayerCharacter' with 'Use `player` pointer'

EnginePluginRun-timeAPI.md:4781:Returns the view frame structure for the specified frame. `view` is the number you get from the editor (that's used in `SetCharacterView` and so forth), not the view minus 1.
Replace 'SetCharacterView' with 'Character.LockView'

EnginePluginRun-timeAPI.md:4914:#### IAGSEngine.IsChannelPlaying
Replace 'IsChannelPlaying' with 'AudioChannel.IsPlaying'

EnginePluginRun-timeAPI.md:4916:int IsChannelPlaying (int channel);
Replace 'IsChannelPlaying' with 'AudioChannel.IsPlaying'

EnginePluginRun-timeAPI.md:4942:**NOTE:** You should normally just use the PlaySound, PlaySoundEx and PlayMusic functions (via GetScriptFunctionAddress) to play sounds - only use this function in specific circumstances.
Replace 'PlayMusic' with 'AudioClip.Play'

EnginePluginRun-timeAPI.md:4942:**NOTE:** You should normally just use the PlaySound, PlaySoundEx and PlayMusic functions (via GetScriptFunctionAddress) to play sounds - only use this function in specific circumstances.
Replace 'PlaySound' with 'AudioClip.Play'

EnginePluginRun-timeAPI.md:4942:**NOTE:** You should normally just use the PlaySound, PlaySoundEx and PlayMusic functions (via GetScriptFunctionAddress) to play sounds - only use this function in specific circumstances.
Replace 'PlaySoundEx' with 'AudioClip.Play'

EnginePluginRun-timeAPI.md:4966:**IMPORTANT:** The returned struct is read-only. You should not modify any members of it directly; rather, call the script functions such as `ChangeCursorGraphic` which ensure that the game state is updated properly.
Replace 'ChangeCursorGraphic' with 'Mouse.ChangeModeGraphic'

EnginePluginRun-timeAPI.md:5254:#### IAGSEngine.SetMousePosition
Replace 'SetMousePosition' with 'Mouse.SetPosition'

EnginePluginRun-timeAPI.md:5256:void SetMousePosition(int x, int y);
Replace 'SetMousePosition' with 'Mouse.SetPosition'

Gamevariables.md:6445:game.close_mouth_end_speech_time | At the end of speech text, the speech animation will stop for this number of game loops. Default 10. No affect in voice mode.
Replace 'game.close_mouth_end_speech_time' with 'Speech.AnimationStopTimeMargin'

Gamevariables.md:6469:game.skip_speech_specific_key | Default 0. You can set it to a keycode, in which case only that key can skip speech text.
Replace 'game.skip_speech_specific_key' with 'Speech.SkipKey'

Gamevariables.md:6471:game.speech_text_align | Sets how text in LucasArts-style speech is aligned. Same possible values as game.text_align, default eAlignCentre
Replace 'game.speech_text_align' with 'Speech.TextAlignment'

ScriptingTutorialPart1.md:9076:*AddInventory* in the manual, you'll find it takes two parameters, an
Replace 'AddInventory' with 'Character.AddInventory'

TextParser.md:11956:could just use the InputBox command (but it has quite a short line
Replace 'InputBox' with 'Game.InputBox'
ivan-mogilko commented 1 year ago

That looks interesting; thank you!

There are couple false-positives in the engine API, but overall these cases need to be fixed.