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 General Discussion »Script error question

Author Topic: Script error question (4 messages, Page 1 of 1)
Moderators: Dennis

S12Spark
Joined: Apr 25, 2015


Posted: Aug 8, 2016 10:36 PM    Msg. 1 of 4       
I'm trying to test out health regeneration, and I used the script from H3 foundry, however it is giving me an error, and I obtained it from the map itself using "Halo Script Extractor, by Skarma"

Here is the script:
(global short plyrnum 0)

(global real regen_amount 10.00)

(script static unit player
(begin
(unit
(list_get
(players) plyrnum))))

(script continuous void condensed
(begin
(sleep 2)
(if
(and
(>=
(unit_get_shield condensed) 1.00)
(<
(unit_get_health condensed) 1.00))
(unit_set_current_vitality condensed
(+
(*
(unit_get_health condensed) 75.00) regen_amount)
(*
(unit_get_shield condensed) 75.00)))))


and here is the error
08.08.16 21:40:33  sapien pc 01.00.09.0620 ----------------------------------------------
08.08.16 21:40:33 reference function: _write_to_error_file
08.08.16 21:40:33 reference address: 401b13
08.08.16 21:40:33 CreateDevice succeeded with refresh rate = 0
08.08.16 21:40:33 Sound card doesn't meet minimum hardware requirements. Disabling hardware option.
08.08.16 21:40:34 Increasing sound decompression buffer size to 1048576 bytes
08.08.16 21:40:34 recompiling scripts after scenarios were merged.
08.08.16 21:40:34 this left parenthesis is unmatched.: (script continuous void condensed


And from what I can tell, the parenthesis is NOT unmatched, but I may be wrong, can anyone tell me what I am doing wrong here?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Aug 8, 2016 11:59 PM    Msg. 2 of 4       
Continuous script's shouldn't list a datatype; only static and stubs are allowed to have data types. This script extractor also apparently doesn't keep track of other script names; it replaced all references to the static player script, with the name of the script it was already in (which would create these issues, as condensed wouldn't be defined to reference, until it had already completely compiled condensed, which it cannot do since it refers to itself)

Also, you never change plyrnum, meaning it can only ever heal the newest spawned player.

(global short plyrnum 0)
(global real regen_amount 10.0)
(script static unit player (unit (list_get (players) plyrnum)))

(script continuous regen
(sleep 2)
(if
(and
(>= (unit_get_shield (player)) 1)
(< (unit_get_health (player)) 1)
)
(unit_set_current_vitality (player)
(+ (* (unit_get_health (player)) 75) regen_amount)
(* (unit_get_shield (player)) 75)
)
)
(if (= plyrnum 15) (set plyrnum 0) (set plyrnum (+ plyrnum 1)))
)


S12Spark
Joined: Apr 25, 2015


Posted: Aug 9, 2016 12:07 AM    Msg. 3 of 4       
I really appreciate the help, and it is working now, thank you. It's a shame the script extractor doesn't extract scripts intact.


Super Flanker
Joined: Oct 5, 2012

The length of your life depends on my aim.


Posted: Aug 9, 2016 07:36 AM    Msg. 4 of 4       
Occasionally you have to append parenthisis but most of the time it gets the job done.

Depending on whichever one you are using.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 7:56 AM 140 ms.
A Halo Maps Website