Send me the script. Just the portion for the lives, don't need to see all the rest.
Who wrote these? The formatting is making me sad :[
One thing. If the player has deathless player on, then it would be easy for you to just use:
(sleep_until (= (unit_get_health player) 0) 15)
rather than doing <= 0.01 as you are now.
Second, the death cutscene is extremely inefficient. For every second, you're continuously invoking the death cutscene command, which wouldn't play until lives = 0. What's an O(1) exercise suddenly becomes an O(n) exercise. Just make it a dormant, and use the (wake death_cutscene) command when you want to play it, when lives = 0. Speaking of which...
Your title display script is also extremely inefficient. It's a continuous which plays everything in order. What you have right now, is:
if lives = 5, then display the title, and sleep until lives = 4. Then check again, and see if lives = 4. If yes, display the title. Again, an O(n) exercise becomes O(n^2), because you have to check it twice.
What you should do instead:
(script continuous lives
(if
(>= lives 0)
(begin
(if
(= lives 11)
(cinematic_set_title livesmax)
)
(if
(= lives 10)
(cinematic_set_title lives9)
)
(if
(= lives 9)
(cinematic_set_title lives8)
)
(if
(= lives 8)
(cinematic_set_title lives7)
)
(if
(= lives 7)
(cinematic_set_title lives6)
)
(if
(= lives 6)
(cinematic_set_title lives5)
)
(if
(= lives 5)
(cinematic_set_title lives4)
)
(if
(= lives 4)
(cinematic_set_title lives3)
)
(if
(= lives 3)
(cinematic_set_title lives2)
)
(if
(= lives 2)
(cinematic_set_title lives1)
)
(if
(= lives 1)
(cinematic_set_title lives0)
)
)
(wake death_cutscene)
)
)
Once you finish adding in this optimization code, one of the prerequisites for it to run is that lives >= 0, and the first cutscene title would be displayed by lives = 11. Your old script would check that lives = 11 as well. However, a quick scroll to the top of the script reveals that lives = 10. Change that to 11, and you're set.
List of things to do:
- Use my optimization script
- At the very beginning of the script, set (cheat_deathless_player true)
- At the very top of the lives and cutscenes.hsc, set lives = 11
- Change death_cutscene to a dormant script, and remove the check for whether no_lives = true.
Edited by Gamma927 on Oct 20, 2010 at 07:25 PM