LinkTo()

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

ExPie
CJ Wannabe
CJ Wannabe
Posts: 28
Joined: January 20th, 2013, 10:56 pm

Re: LinkTo()

Post by ExPie » January 24th, 2013, 11:51 am

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?

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: LinkTo()

Post by F |Madness| U » January 24th, 2013, 1:15 pm

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.
Last edited by F |Madness| U on January 24th, 2013, 6:49 pm, edited 1 time in total.
-

ExPie
CJ Wannabe
CJ Wannabe
Posts: 28
Joined: January 20th, 2013, 10:56 pm

Re: LinkTo()

Post by ExPie » January 24th, 2013, 6:44 pm

So if I had a function insertanynamehere() what exact code must I use to end it from another function?

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: LinkTo()

Post by F |Madness| U » January 24th, 2013, 6:51 pm

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.
-

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: LinkTo()

Post by Rezil » January 24th, 2013, 7:32 pm

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");
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

ExPie
CJ Wannabe
CJ Wannabe
Posts: 28
Joined: January 20th, 2013, 10:56 pm

Re: LinkTo()

Post by ExPie » January 24th, 2013, 8:59 pm

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests