
alfrejof
Joined: Jun 24, 2010
yeah really
|
Posted: Jul 31, 2010 11:01 AM
Msg. 1 of 2
hey guys, well thanks for all the help, you guys are awesome:)
well heres my problem, im making a ``somehow´´ firefight map, what i mean is not that im making waves and waves of enemies, nor those kind of things, but what im making is a map, where you grab a lot of weapons go through a teleporter and enter a massacre for 10 minutes, full of AI, but what i want you to help me with, is that i want you to tell me, what script should i use to make a checkpoint for every 5 minutes (note that im new to script and the only thing i know is that its a wordpad file with an extension of .hsc), and also make a timer, that counts the time youre up in the part of the masacre,and when the timer hits down cero or it counts until ten minutes, the game is over, and probably tells you how many have you killed and those kind of things, but thats optional. so i think this is possible and not to complicated, so if you guys can help me out and also tell me if this map can only be for single player or multiplayer
thanks, alfrejof
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Jul 31, 2010 11:14 AM
Msg. 2 of 2
Counting the amount of AI that was killed requires this script concept that I'm not sure if it works because I just woke up. I was thinking of having separate squads, checking when one dies, and then manually respawning it while adding the number of the AI in that squad to the amount killed. However, to display this, you'd have to either have a super long string of hud messages or a lot of chapter titles.
TL;DR: Don't bother with displaying the amount killed.
For your timer, this would work:
(script startup timer (show_hud_timer true) ;; Shows the timer (hud_set_timer_time 10 0) ;; Sets the timer's time to 10 minutes (sleep (* (* 60 10) 30)) ;; Sleeps for 10 minutes. I'm doing multiplication cuz I'm too lazy to multiply this stuff out this early in the morning (player_enable_input 0) ;; Player can't move (object_cannot_take_damage (list_get (players) 0)) ;; Player can't die (ai_disregard (players) true) ;; AI ignore players () ;; FILL THIS PART IN YOURSELF )
Now, you're wondering why I didn't fill in the HUD text stuff for you. This part is a bit complicated. You're going to have to create a new txt file, renamed to hud messages.hmt (hmt being the file extension). When you save this, make sure it's set to unicode encoding. Then, inside, place your HUD texts in this format:
INDEX=OBJECTIVE TEXT
So if I wanted to display something like, ">>Go through the teleporter", I'd use:
obj1=>>Go through the teleporter
Please note that obj1 is the index, and that we'll be referring to that in the script. Once you've filled the hud messages.hmt file with your objectives (NOTE. YOU CANNOT HAVE TWO SAME INDEXES.) Then, CLOSE SAPIEN, and open your command prompt. Type in:
tool hud-messages DIRECTORY OF SCENARIO FILE NAME OF SCENARIO FILE
So if your scenario file was inside tags\levels\firefight\firefight.scenario, you'd put your hud messages.hmt file inside: data\levels\firefight
Then, you'd type into tool:
tool hud-messages levels\firefight firefight
Compile it.
Re-open Sapien AFTER COMPILING. Inside your script, add
(show_hud_help_text true) ;; Displays HUD help text (hud_set_objective_text INDEX) ;; Sets the objective thing in the pause menu (hud_set_help_text INDEX) ;; Sets the HUD text to this (sleep 150) ;; Sleeps for five seconds (show_hud_help_text false) ;; Stops displaying HUD help text
Replacing INDEX with your index from your hud messages.hmt file. So if your index was obj1, you'd use something like:
(show_hud_help_text true) (hud_set_objective_text obj1) (hud_set_help_text obj1) (sleep 150) (show_hud_help_text false)
Now, cut that entire block and paste it where I said to (). THIS IS NOT A STANDALONE SCRIPT. YOU CANNOT USE THIS ALONE.
So your final script would be like:
(script startup timer (show_hud_timer true) ;; Shows the timer (hud_set_timer_time 10 0) ;; Sets the timer's time to 10 minutes (sleep (* (* 60 10) 30)) ;; Sleeps for 10 minutes. I'm doing multiplication cuz I'm too lazy to multiply this stuff out this early in the morning (player_enable_input 0) ;; Player can't move (object_cannot_take_damage (list_get (players) 0)) ;; Player can't die (ai_disregard (players) true) ;; AI ignore players (show_hud_help_text true) (hud_set_objective_text obj1) (hud_set_help_text obj1) (sleep 150) (show_hud_help_text false) )
PLEASE NOTE THAT THIS ONLY SETS UP THE TIMER AND THE OBJECTIVE TEXT. THIS DOES NOT ADD IN AI OR WHATEVER ELSE YOU WANT.
And this map has to be single player only, as AI will not sync over the internet.
|
|
|
| |
|
|
 |
|