Page 3 of 3

Re: LinkTo()

Posted: January 24th, 2013, 11:51 am
by ExPie
Ok strange. It is working in /map normaly. But I must run it in /devmap first in order for triggers to link. How do I fix this?

Re: LinkTo()

Posted: January 24th, 2013, 1:15 pm
by F |Madness| U
ExPie wrote:
And another question. Is there a function you can call to end anoter function?

Code: Select all

function_you_want_to_end()
{
        self endon("this_is_how_to_end_a_function");
        ...
}
 
somewhere else()
{
        level notify("this_is_how_to_end_a_function");
}
Basically the level notify sends that message across the whole script (if you use level, rather than self or something else). And the first function receives that `message`, and hence ends.

Not sure about your /map /devmap problem sorry.

Re: LinkTo()

Posted: January 24th, 2013, 6:44 pm
by ExPie
So if I had a function insertanynamehere() what exact code must I use to end it from another function?

Re: LinkTo()

Posted: January 24th, 2013, 6:51 pm
by F |Madness| U
It depends on the scenario, for the usage of self/level. However I imagine the use in my example should suit your needs. Simply look at the code above and change the function names and the notify/endon string to whatever you want, I recommend something like "endX" where X is whatever it is stopping.

Re: LinkTo()

Posted: January 24th, 2013, 7:32 pm
by Rezil
So if I had a function insertanynamehere() what exact code must I use to end it from another function?

Code: Select all

insertanynamehere()
{
        /*This line is not blocking, it means that this function will end when "unique_message_here" is called */
        level endon("unique_message_here"); 
        
        /* The rest of your code here */
}
When you want this function to end, you call

Code: Select all

level notify("unique_message_here");

Re: LinkTo()

Posted: January 24th, 2013, 8:59 pm
by ExPie
Thx Rezil. Thx for all your help. But rly nobody knows why the triggers wont be linked to ent I asigned them unless I run /devmap first?