declaring for 'This'

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
djhubertus
Translator
Translator
Posts: 1252
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

declaring for 'This'

Post by djhubertus »

I saw on some scripts that it's possible to declare variables for This but I can't find any informations about that. Is it declaration to server?
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
zocka
Posts: 205
Joined: 15 Jun 2010, 17:56

Re: declaring for 'This'

Post by zocka »

'This' represents the current context (CMlBrowser in Manialinks, CEditorPlugin in editor plugins, C(T|S)mMode in gamemodes etc) being the "entry point" to access e.g. CMlScript::Page as implicit This.Page.
As I understand it, it is the most general qualified object you could 'declare for'.

(However I don't have experience with using persistent declarations for This. I would assume that declaring persistent variables for the CMlBrowser itself could be available to every Manialink as they share the Browser whereas the Page variable is associated with a certain page.)
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka
User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: declaring for 'This'

Post by Dommy »

Declaring stuff for LocalUser is helpful in keeping data between manialinks and other places, like plugins. However this doesn't work well if there is no title pack loaded.
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest