
The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Jul 13, 2011 02:29 AM
Msg. 1 of 11
You don't? Well blow it out your ass, I made a clock! It's been scaled down to function reasonably in gameplay, and by that I mean it's not real-time. Because honestly, who is going to leave their computer on for 24 hours with a Halo map running just to have the day change? Every 30 seconds in real-time is equal to 1 hour in game-time. I wrote this up in a jiffy because it's something which will be utilized in Red Skulls to control... some things... you'll see. I realized there's nothing "secret" about a clock so I might as well share for anyone who needs one for something but never knew you needed to use a clock for something until you heard me talking about using clocks in a Halo script and now you desperately need to use this clock for something cool and release it soon to be cool and awesome. As you can see, it's currently set to the "Thursday" setting for no apparent reason. (global short seconds 0)
(global short minutes 0)
(global short hours 0)
(global short days 0)
(global short weekday 5)
(global string dayofweek "Thursday")
(script continuous clock (if (>= seconds 5) (begin (set minutes (+ minutes 1)) (set seconds 0) )) (if (>= minutes 6) (begin (set hours (+ hours 1)) (set minutes 0) )) (if (>= hours 24) (begin (set days (+ days 1)) (if (< weekday 7) (set weekday (+ weekday 1)) (set weekday 1)) (if (= weekday 1) (set dayofweek "Sunday")) (if (= weekday 2) (set dayofweek "Monday")) (if (= weekday 3) (set dayofweek "Tuesday")) (if (= weekday 4) (set dayofweek "Wednesday")) (if (= weekday 5) (set dayofweek "Thursday")) (if (= weekday 6) (set dayofweek "Friday")) (if (= weekday 7) (set dayofweek "Saturday")) (set hours 0) )) )
(script continuous metronome (sleep 30) (set seconds (+ seconds 1)) ) Second on the agenda... LOL I said second! And it's a clock? *crickets* Jerks. Next I've got the health regeneration script which I promised would be released. It's waaay cooler than the one you're using (yeah I'm talkin' to you). It regenerates the health gradually so that you can actually look and see it rising on the health meter. The places with brackets, you'll need to fill in yourself because it varies from map to map. I've set them out in bold to make them easier for you to see (ah you're welcome, no problem, no it's perfectly fine, keep your wallet in your pants no need to thank me with a reward). (script static unit player (unit (list_get (players) 0)) )
(global real health_increment 0)
(script static real shield (unit_get_shield (player)) )
(script static real health (unit_get_health (player)) )
(script static real unchanged_shield (* (shield) [your biped's shield strength]) )
(script static real health_number (* (health) [your biped's health]) )
(script static real health_lost (- [your biped's health] (health_number)) )
(script static void increase (unit_set_current_vitality (player) (+ (health_number) health_increment) (unchanged_shield)) )
(script static real health_increment_set (set health_increment (/ (health_lost) 20)) )
(script continuous health_recharge (sleep_until (and (< (health) 1) (= (shield) 1))) (health_increment_set) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) ) From the way it's currently set up, it takes ten seconds to regenerate fully, healing 5% of your lost health every half a second. And that's all she wrote. Edited by The Cereal Killer on Jul 13, 2011 at 02:48 AM
|
|
|

Diaboy
Joined: Jan 24, 2011
A self-fulfilling prophecy of endless possibility
|
Posted: Jul 13, 2011 07:50 AM
Msg. 2 of 11
Awww man, clocks? Totes misread that.
Haha, neat! Looks awesome, I can't wait to see more from this SP mod. Very helpful stuff here :)
|
|
|

cyboryxmen
Joined: Nov 7, 2010
--CG artist-- New mission. Refuse this Mission!
|
Posted: Jul 13, 2011 09:39 AM
Msg. 3 of 11
According to the script, Saturday doesn't exist. I suggest you do the necessary armaments to the script to include it. (if (<= weekday 7) There we go. -Zekilk
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Jul 13, 2011 02:30 PM
Msg. 4 of 11
I never said it was difficult, I released it because I wondered what people who have the skill to utilize it will come up with.
@Cybor: No, that would break it. 1=Sunday, 2=Monday... 7=Saturday. The conditional (if (< weekday 7)... controls whether it sets the weekday number up one. If the command you suggested is used, it will increase the number by 1 even if it is already 7, meaning it would become 8 which has no value as a day of the week.
What does anyone think of the health regeneration? Edited by The Cereal Killer on Jul 13, 2011 at 04:19 PM
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Jul 13, 2011 04:24 PM
Msg. 5 of 11
Quote: Does your script reset weekday to 0, once surpassing 7? Otherwise the string will freeze on Saturday. Son of a... mistyped it up there, fixed it though. I meant to say that 1=Sunday. Thanks, and yes it returns a decimal amount of health with a degree of precision at 6 places after the decimal point (which would be one-millionth segments of your health). So if your health was 0.9999 of its total, not only would it return that but it would return 0.999900.
|
|
|

milkkookie
Joined: Aug 10, 2010
:)
|
Posted: Jul 13, 2011 05:00 PM
Msg. 6 of 11
but will it blend?
|
|
|

Skidrow925
Joined: Mar 19, 2010
"ideological sense of respect and tact of a 5yo"
|
Posted: Jul 13, 2011 05:13 PM
Msg. 7 of 11
I don't believe in 30 second hours.
|
|
|

Bottletopman
Joined: Feb 5, 2011
Blessed are the cheesemakers
|
Posted: Jul 13, 2011 07:55 PM
Msg. 8 of 11
Nice scripts, especially the gradual health regen, I remember seeing a video of it on xfire, can't remember the link though. Now people can make maps closer to Halo 3, because in Halo 3, you actually have health, and it also takes 10 seconds to fully recharge Edited by Bottletopman on Jul 13, 2011 at 07:56 PM
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Jul 13, 2011 08:07 PM
Msg. 9 of 11
'Twas not Xfire, I mainly upload to Youtube. http://www.youtube.com/watch?v=2ThA-QRJ2g0 is probably the video you saw, though it's been changed since then to rise more smoothly back to full. Yes, Halo 3 -ish is what I was aiming for, considering the Spartan 2s in that game wear the same Mjolnir Mark 6 armor that the Spartan 2s in Red Skulls will wear. Edited by The Cereal Killer on Jul 13, 2011 at 08:09 PM
|
|
|

Spartan314
Joined: Aug 21, 2010
Former biped rigger & FP animator
|
Posted: Jul 20, 2011 05:17 AM
Msg. 10 of 11
Quote: --- Original message by: The Cereal Killer(script static unit player (unit (list_get (players) 0)) )
(global real health_increment 0)
(script static real shield (unit_get_shield (player)) )
(script static real health (unit_get_health (player)) )
(script static real unchanged_shield (* (shield) [your biped's shield strength]) )
(script static real health_number (* (health) [your biped's health]) )
(script static real health_lost (- [your biped's health] (health_number)) )
(script static void increase (unit_set_current_vitality (player) (+ (health_number) health_increment) (unchanged_shield)) )
(script static real health_increment_set (set health_increment (/ (health_lost) 20)) )
(script continuous health_recharge (sleep_until (and (< (health) 1) (= (shield) 1))) (health_increment_set) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) (sleep 15) (increase) ) I tried to use this script, but then I realized, I have no idea what I'm going to put for the biped's shield strength, and biped's health. What should I do to get the number?
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Jul 20, 2011 12:23 PM
Msg. 11 of 11
Look in your biped's collision model.
|
|
|
| |
|
|
 |
|