Custom Function with Dialog Variable (SOLVED)

Started by mode7, Mon 18/10/2010 17:55:03

Previous topic - Next topic

mode7

I want to start a dialog by calling a custom function which does various stuff before showing the dialog.

function StartDialog (Dialog);
{
//random stuff...
Dialog.Start() // This is where I get an error
}

I know i'd probably have to write something  instead of  "Dialog" in the start command but I can't figure out what. I'm still very inexperienced handling structs.

Dualnames

#1
Code: ags

function StartDialog(this Dialog*) {
//random stuff
this.Start();
}


So when you want to use it you'll go like:

dDialog1.StartDialog();

More info:
http://www.adventuregamestudio.co.uk/manual/ExtenderFunctions.htm
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

Also, before extender functions came along, the way to do this was:

Code: ags
function StartDialog (Dialog* d);   // function parameters are declared just like variables
{
  //random stuff...
  d.Start();
}

mode7


SMF spam blocked by CleanTalk