User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: float to bool

  1. #11
    Octorok CaRmAgE's Avatar
    Join Date
    Oct 2008
    Location
    Historia
    Age
    35
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,336
    Level
    12
    vBActivity - Bars
    Lv. Percent
    43.35%

    Re: float to bool

    Quote Originally Posted by Joe123 View Post
    And maybe you can and I just didn't realise.
    Why would you need to?
    Having braces just by themselves in C allows you to limit the scope of variables declared inside the braces. Not sure what use it would have in Zscript, though...

  2. #12
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.92%

    Re: float to bool

    Aha, that makes sense.
    That application would stretch to ZScript as well, if you can do that in ZScript.

  3. #13
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,580
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.43%
    Achievements It's over 9000!

    Re: float to bool

    Incidentally, we should have a slot 4 global script that triggers on Link's death. It would get to run for one frame, and if Link's HP is still zero after that, he dies for real.
    Man, I have recommended that SO many times... I think this is just something ZC should naturally have. It can be so very useful...

    I mean even having it check to see whether Link's Health is near .0001% health is entirely impractical because there are attacks which do just enough damage to bypass that critical checking point. So it'd be something like, if(Link->HP <= 1%(Link->MaxHP){etc} or whatever it'd be. (Never was too clear on the syntax.) and that'd work just fine, because it'd also be able to accommodate Link being at less than zero health.

  4. #14
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.92%

    Re: float to bool

    Quote Originally Posted by ShadowTiger View Post
    I mean even having it check to see whether Link's Health is near .0001% health is entirely impractical because there are attacks which do just enough damage to bypass that critical checking point. So it'd be something like, if(Link->HP <= 1%(Link->MaxHP){etc} or whatever it'd be. (Never was too clear on the syntax.) and that'd work just fine, because it'd also be able to accommodate Link being at less than zero health.
    What're you trying to suggest here

    Link's health is an integer value I believe.

  5. #15
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,580
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.43%
    Achievements It's over 9000!

    Re: float to bool

    I'm just reiterating what I had quoted.

    It would get to run for one frame, and if Link's HP is still zero after that, he dies for real.
    To give the game at least one frame of confirmation that Link's Health really is at zero before giving the game over screen, to allow scripts to run or restore his health and do whatever else the scriptmaker wants it to do. I had no intention of mentioning value types.

  6. #16
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.92%

    Re: float to bool

    Oh wait you have '1%Link->MaxHP' rather than '1/Link->MaxHP'.
    I thought you'd put a back-slash, and in which case you'd have a value smaller than one. In which case, if the integer value is less then a number smaller than one then it has to be zero anyway, so you may as well have put 0. So this is why I'm confused.

  7. #17
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,580
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.43%
    Achievements It's over 9000!

    Re: float to bool

    Now I'm confused too.

    Okay. Let's backtrack. Let's not think of any C++ here. Let's think of the practical, pragmatic purposes for the discussion here.

    We need a single frame between Link's HP being 0 or whatever, and the Game Over screen. Let's talk about that, please? I'm seriously getting confused and bewildered that nothing I'm saying is getting across with any sign of acknowledgment.

  8. #18
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,305
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.92%

    Re: float to bool

    Oh, sorry.
    I agree that we should have a global script that runs when Link dies, but I know full well that I'm not currently capable of adding that in in the slightest.

    I wasn't sure whether you were suggesting that line of code to be added into a script, or into ZC's code itself.
    'cause it wouldn't really be much use actually in ZC. I'm pretty sure (althought I may well have missed it) that there isn't even a Link object in ZC's code.
    I know I'm just being pedantic there (there is a LinkData object), but even so it'd be a lot more complicated than that.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social