A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Kill Count?

Author Topic: Kill Count? (6 messages, Page 1 of 1)
Moderators: Dennis

rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Nov 19, 2010 06:09 AM    Msg. 1 of 6       
Would it be possible to make a script that would keep track of a players kills in a single player map? Or at least the number of AI killed on any team by anyone. (All friendly's are invincible)

It would be nice to be able to display this on the hud but just being able to for scripting purposes would be extremely helpful for setting a script like "after 200 kills run script"


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Nov 19, 2010 06:15 AM    Msg. 2 of 6       
Only possible either with specific-numbered encounters or with bipeds assigned to AI.

With numbered encounters, if had an encounter of, say, 10, it would update +10 after that encounter was killed. To do this:

(global short score 0)

(ai_place EncounterExample)
(sleep_until (= (ai_living_count EncounterExample) 0))
(set score (+ score 10))



With bipeds assigned to ai, do this:

(global short score 0)
(object_create dude)
(sleep 15)
(sleep_until (= (unit_get_health (dude)) 0))
(set score (+ score 1))



Hope this helped.
Edited by MoooseGuy on Nov 19, 2010 at 06:43 AM


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Nov 19, 2010 06:26 AM    Msg. 3 of 6       
Okay, how would I go about assigning a biped to AI.

I have two hostile encounters, and I only need to keep track on one's deaths for scripting purposes.

EDIT: Actually never mind. It just occurred to me that my second encounter doesn't have to infinitely re-spawn like the first.
Edited by rerout343 on Nov 19, 2010 at 06:29 AM


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Nov 19, 2010 06:32 AM    Msg. 4 of 6       
If you are keeping track of a specific one in a big encounter, then it's easy. Create the encounter with other ai spawning, then the specific one you want to keep track of will be a separate biped. Create the biped in sapine and make sure its not created initially. Name it, um, Mooose.

(object_create_anew Mooose)
(ai_attach Mooose EncounterExample)
(sleep 15)
(sleep_until (= (unit_get_health (Mooose)) 0))
(set points (+ points 10))


That's the basic way to do it. You might want to set a marker above him, much like the grunt who is running to the gun turret in a50. Good luck!
Edited by MoooseGuy on Nov 19, 2010 at 06:43 AM


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Nov 19, 2010 06:46 AM    Msg. 5 of 6       
Actually the second encounter will have 15-30 actor variants that I need to keep track of.
Edited by rerout343 on Nov 19, 2010 at 06:47 AM


Polamee
Joined: Feb 25, 2008

MP2SPMT's founder


Posted: Nov 19, 2010 08:13 AM    Msg. 6 of 6       
Its possible, and an interesting prospect. Personally, I've made a map where grunts constantly stream at a player and you eliminate as many as possible in 2 minutes, and are rewarded according to the number of kills. (http://www.youtube.com/watch?v=C4MAdb5idYg)

The front part of the video is sort of what you want, no?

So if you want the player to know how many grunts he's killed, then there's a problem. You'll need to use HUD messages, meaning a separate HUD message for each number of AI killed. So you'll need to attach a cap to the number of enemies in the level. Say its 70. Then compile a HUD message file as you would do an objective file. Inside, you type out 70 individual HUD messages, each of them unique to the number of AI that would die.

So it would be something like:
msg1=You have killed 1 enemy in total
msg2=You have killed 2 enemies in total
msg3=You have killed 3 enemies in total

And so on until you reach the maximum number of AI. Compile with tool, then script the encounter.

Using the method MooseGuy mentioned above, calculate how many AI the player has killed, and add 1 to the variable whenever a new kill is detected. (Alternatively, you could do what I did in the map mentioned above, which was to assign a single AI individual to his own squad, and running a continuous script that would detect if he was dead, then add 1 to the variable and respawn him. Your choice)

At the end of the level, your variable should equal the number of AI killed. So what I did was compile a lengthy script that would display each corresponding HUD message to the variables. I'm sure there's a simpler method, but I await some smarter person to figure it out for me.

Ok, so your script that assigns the correspondence would be:

(script startup score
[insert event that would determine the end of the level]
(if (= score 1))
(show_hud_help_text true)
(hud_set_help_text msg)
(sleep 150)
(show_hud_help_text false)

(if (= score 2))
(show_hud_help_text true)
(hud_set_help_text msg2)
(hud_set_objective_text msg2)
(sleep 150)
(show_hud_help_text false)

And so on....(the entire process will take you less than an hour, unless you're really that slow. Its incredibly frustrating though)

Sorry if that was incoherent or messy, but I can't find an easier way of explaining it.
Edited by Polamee on Nov 19, 2010 at 08:15 AM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 2:29 PM 125 ms.
A Halo Maps Website