Sign in to follow this  
Followers 0
giraffe

UI Overview

14 posts in this topic

Tiddy-bits:

Late reply but I need to make a correction: a UI button cannot wake a dormant script, they can only run static scripts.

 

This goes for event handlers in general, of course, not just if the widget is a button. If the event handler is given a script, it must be a static script to work.

 

Not sure how I missed this before but good tut.

Edited by TCK

Umh7x1l.gif

Share this post


Link to post
Share on other sites

Late reply but I need to make a correction: a UI button cannot wake a dormant script, they can only run static scripts.

 

This goes for event handlers in general, of course, not just if the widget is a button. If the event handler is given a script, it must be a static script to work.

I've been waking dormant scripts via widgets since 2009.

Here are some examples of maps that wake dormant scripts through widgets:

http://hce.halomaps.org/index.cfm?fid=4428

http://hce.halomaps.org/index.cfm?fid=4693

http://hce.halomaps.org/index.cfm?fid=4771

If you are having problems waking dormant scripts through widgets then you can see if moving them to their own HSC file helps.

Share this post


Link to post
Share on other sites

Post an example dormant script from the raw .hsc which you know has been successfully woken by a UI event handler and let me look real quick, if you would. There are a couple things I'm curious about now.

Edited by TCK

Umh7x1l.gif

Share this post


Link to post
Share on other sites

Post an example dormant script from the raw .hsc which you know has been successfully woken by a UI event handler and let me look real quick, if you would. There are a couple things I'm curious about now.

(script dormant disco
    (fade_in 14.00 200.00 250.00 150)
)

Share this post


Link to post
Share on other sites

I was hoping yours would have a void return value specified, or some other quirk which would mean that's why it was overlooking mine. Hm.

 

I have no idea then. All I know is back on Modhalo I tried it a dozen different ways with dormant scripts before trying a static, only to have it work instantly and smack myself for it. And then right after, when Deadhamster wrote a tut for it (http://www.modhalo.net/index.php?/topic/29036-linking-scripts-to-ui-buttons/) he and I were talking about it on Xfire as he was writing it. Right before he posts it, he sends me a copy and asks me to proofread it; and I say, "hey this part about dormant scripts is gonna frustrate the shit outta some kids, because it won't work unless it's a static." So he changed it to a static before posting it.

Edited by TCK
NeX and WaeV like this

Umh7x1l.gif

Share this post


Link to post
Share on other sites

Hey.

 

...I STILL can't get the UI to wake dormant scripts.

 

If what he's saying is the cause, that they need their own .hsc, then I suppose that would explain it since I've got a raging habit of making one large .hsc per scenario and just commenting off sections for different purposes. Still, I maintain that a static is 9/10 times the better choice for a button.

Edited by TCK

Umh7x1l.gif

Share this post


Link to post
Share on other sites

If what he's saying is the cause, that they need their own .hsc, then I suppose that would explain it since I've got a raging habit of making one large .hsc per scenario and just commenting off sections for different purposes.

 

That's a pretty good idea; isn't there a limit to the number of individual .hsc files you can compile in a single scenario?


KsqHutE.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.