Results 1 to 9 of 9

Thread: hud_set_help_text scoring system

  1. #1
    The Prophet Brohammed
    Join Date
    Feb 2008
    Location
    Picayune, MS
    Posts
    121

    hud_set_help_text scoring system

    Making a scoring system, have the score defined as a long int, etc. Having problems actually displaying the score on the HUD. My idea was to create a hud_help_text for every possible score (right now multiples of 50 between 0 and 10k) which I did, and then used a script to display them when the score is whatever

    ex:
    Code:
    (cond
    ((= score 7200)(hud_set_help_text score_7200))
    ((= score 7250)(hud_set_help_text score_7250))
    ((= score 7300)(hud_set_help_text score_7300))
    )
    Problem is I already have a script about twice as long as longcat, and I can't even fit the 50-10k score thing in because I guess I'm hitting some sort of limit for script length (~3300 lines I start having problems) So I'm trying to figure out a better way to do this, but I'm pretty much drawing a blank.

    I thought of trying something like:
    Code:
    ((= score[variable] #)(hud_set_help_text "score_"score[variable] ))
    Is there any way to do something like that, so that'd I'd only need 1 line and it would pull the value of the score integer variable and input it in the place after the underscore? It seems like it should be possible but I can't figure it out.

    Hell even another type of scoring system would be fine too.

  2. #2
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: hud_set_help_text scoring system

    Set the timer.

  3. #3
    The Prophet Brohammed
    Join Date
    Feb 2008
    Location
    Picayune, MS
    Posts
    121

    Re: hud_set_help_text scoring system

    Quote Originally Posted by Dwood View Post
    Set the timer.
    Yea, but the timer has 3 sets of 0s, minutes, seconds, and 1/100ths seconds, and you can only set minutes and seconds, so it can't be numbers ending in 50. Plus there's the whole problem with you can't have higher than 59 seconds or minutes, it just carries over, and you cant even set the minutes higher than like 19 anyway.

    Unless I'm missing something, I messed around with it a bit but it didn't really seem like a good solution.

  4. #4
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: hud_set_help_text scoring system

    While I can see where your problem is, Just have a hud text for each range instead of 1 hud text for every single one you want. If you don't want to do that the only thing you can do is learn how to make things in Open Sauce.

  5. #5
    The Prophet Brohammed
    Join Date
    Feb 2008
    Location
    Picayune, MS
    Posts
    121

    Re: hud_set_help_text scoring system

    Quote Originally Posted by Dwood View Post
    While I can see where your problem is, Just have a hud text for each range instead of 1 hud text for every single one you want.
    So then the HUD would have to say something like "you have somewhere between 2000 and 3000 points, I'm not sure of the exact number though." ?
    Is there really not another way to do this?

  6. #6
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: hud_set_help_text scoring system

    Not without OS

  7. #7
    Sarcastic Bitch
    Join Date
    Sep 2006
    Posts
    811

    Re: hud_set_help_text scoring system

    Quote Originally Posted by Dwood View Post
    Not without OS
    Don't tell people stuff like that unless you are 100% positive that it cannot be done. CAD created a scoring system as seen right here, so you are wrong, it can be done without OS.

    S3anyBoy, try private messaging CAD and see if he will help you out.

  8. #8

    Re: hud_set_help_text scoring system

    Quote Originally Posted by ShadowSpartan View Post
    Don't tell people stuff like that unless you are 100% positive that it cannot be done. CAD created a scoring system as seen right here, so you are wrong, it can be done without OS.

    S3anyBoy, try private messaging CAD and see if he will help you out.
    I messaged this to him, but I'm just going to post it here so everyone can see how it was done:

    The general concept of what i did was break up the score variable into its comprising digits, then used cutscene titles to display the individual digits on the hud. The issue with this is that you can only have 4 active cutscene titles on the screen at one time, so i broke the number into two sets of digits. The first set, the ten-thousands and thousands place, and the second set, the hundreds, tens, and ones place (which is really only two digits when it comes down to scripting, as my scores always go in multiples of at least ten, so the final digit is always 0).

    How i broke the score variable down to its individual digits took some creative scripting, as haloscript doesnt have any integer division/modulo functions. The gist of it was i divided the entire score variable by, say, 1000. For a five digit score, this would result in a value between 0 and 99. I tested this value to see if it was between 0 and 1. If so, the first two digits would be "00", if it was between 1 and 2, then the first two digits would be "01", and so on to 99.

    I took the resulting value (between 0 and 99) and multiplied it back by 1000, then subtracted it from the original score variable. This would give me the final 3 digits (hundreds, tens, ones). Because I only worked in points in multiples of 10, i can then divide this value by ten, and then test these values in the same way i mentioned earlier. If the value was between 0 and 1, the final three digits would be "000", if it was between 1 and 2, the final three digits would be "010", and so on, onto "990".

    Splitting up the digits in this way meant I only use two cutscene titles maximum at a time, and that you only need, at most, 200 "if" tests, rather than 9,999 or so. This method allows it so you can still do a wave counter in much the same way.
    Last edited by CtrlAltDestroy; February 4th, 2010 at 06:38 PM.

  9. #9
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: hud_set_help_text scoring system

    Cool, did not know that.

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •