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 »Points script not working

Author Topic: Points script not working (5 messages, Page 1 of 1)
Moderators: Dennis

rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Feb 25, 2011 05:34 AM    Msg. 1 of 5       
This topic will probably get ignored like all my others, but here goes. I have been trying to get a points system working but just can't seem to get it right. I'm not sure what is causing the problem or which script the problem is in but for some reason I start with 5 points(My test script only goes up to five right now) and if I manually reset it, it immediately jumps back up to five.

My script:

(global short "score" 0)

(script continuous kill
(if (- (ai_living_count zom_test) 1) (set score (+ score 1)))
)

(script continuous points
(if (= score 0) (hud_set_help_text p0))
(if (= score 1) (hud_set_help_text p1))
(if (= score 2) (hud_set_help_text p2))
(if (= score 3) (hud_set_help_text p3))
(if (= score 4) (hud_set_help_text p4))
(if (= score 5) (hud_set_help_text p5))
)

If anyone can tell me what I'm doing wrong, I would appreciate it.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 25, 2011 05:20 PM    Msg. 2 of 5       
The script Juiceb0xhero posted is obviously my old script. Don't use it. In your script, you're attempting to give points per kill rather than by ending the whole wave. However, your if statement does not contain a boolean. Essentially, you're saying:

if the encounter's living count minus one. Although this is slightly legible, it lacks grammatical structure. In order to check if the living count decreased, you need a separate short to store what the living count was before it decreased.

(global short temp 0)

...

(script continuous kill
(set temp (ai_living_count zom_test))
(sleep_until (= (ai_living_count zom_test) (- temp 1)))
(set score (+ score 1))
)


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Feb 25, 2011 05:55 PM    Msg. 3 of 5       
It's still not working. It did give me one point after I killed two enemies,(not exactly right but it's a start) but after that first point, it would not increase past that. My finished map will have limited spawn encounters, but my test one respawns infinitely. Would that have anything to do with it not working?


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Feb 26, 2011 03:17 PM    Msg. 4 of 5       
Quote: --- Original message by: ASP GRUNTS
(global short score 0)
(global short temp 0)

(script continuous kill
(if (> temp (ai_living_count zom_test))
(set score (+ score 1))
)
(set temp (ai_living_count zom_test))
)

(script continuous points
(if (= score 0) (hud_set_help_text p0))
(if (= score 1) (hud_set_help_text p1))
(if (= score 2) (hud_set_help_text p2))
(if (= score 3) (hud_set_help_text p3))
(if (= score 4) (hud_set_help_text p4))
(if (= score 5) (hud_set_help_text p5))
)

Gamma's stupid, never listen to him.


Thanks, that really helped me.


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Mar 11, 2011 10:58 PM    Msg. 5 of 5       
So when someone posts a script, can I just copy and paste to a .hsc file from the script inside the box thing around it. and how do you make the box thing, my scripts just show up in my message boxless.

 

 
Previous Older Thread    Next newer Thread







Time: Sat January 21, 2023 12:36 AM 140 ms.
A Halo Maps Website