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 »Scripts and globals question

Author Topic: Scripts and globals question (9 messages, Page 1 of 1)
Moderators: Dennis

rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: May 6, 2011 07:27 AM    Msg. 1 of 9       
Two quick questions:

First, is there a limit to how many globals I can specify in scripts? The only reason I'm asking is because my script currently contains 54 globals and could easily triple by the time I am done.

Second, is there a way to reference the value of a global in a hud_message, objective, or text box on screen?

Example: Say I have the line (global short numbers 0), now the value of this global will fluctuate up and down during gameplay, and I was wondering if there was a was the have something telling me what the current value is at. Like if numbers was set to 37, something on screen would say something like: "Numbers is set at 37". I know that if it's possible it would be done through strings but that's all I know.

Any help would be appreciated.


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: May 6, 2011 07:44 AM    Msg. 2 of 9       
Well...the problem with that is, if I display these values this way, I need to display them all at once, that would not be possible without make an absurdly high amount of strings. I will just have to find another way to represent them. The first question was the more important one anyway.

Thanks anyway.


lemarr
Joined: May 6, 2011

Surprisingly, I don't take archery


Posted: May 6, 2011 07:45 AM    Msg. 3 of 9       
On another note, how do you use the object_list global type? This would be really useful for scripting in MP.
-Archer1


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: May 6, 2011 07:53 AM    Msg. 4 of 9       
I'm not sure what you mean. Although you may want to start your own thread for that, it's a bad practice to ask for help with unrelated matters in existing threads. I don't mind but some people do.


lemarr
Joined: May 6, 2011

Surprisingly, I don't take archery


Posted: May 6, 2011 08:31 AM    Msg. 5 of 9       
Quote: --- Original message by: Daniel
Quote: --- Original message by: lemarr
On another note, how do you use the object_list global type? This would be really useful for scripting in MP.
-Archer1


An object_list is a list of objects used within the HEK. As far as I am aware you cannot make your own object lists. However the game creates object_lists when you make a new squad of ai for example. For a better view of which commands return an object_list and which commands use an object_list as input, refer to hs_doc.txt


That was what I was afraid of. Damn, I guess I would have to make an (if ) command for all 16 players. Sorry for bothering ya.
-Archer1


The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.


Posted: May 6, 2011 03:19 PM    Msg. 6 of 9       
"Players" is an object_list by default in games. That's why the (unit (list_get (players) 0)) works to refer to the host in MP or the player in SP.

Object_lists aren't used in HEK they're used in the scenario and script. I don't have time to type something out about it right now, but Kirby said he's willing to explain.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: May 6, 2011 03:37 PM    Msg. 7 of 9       
I've experimented with them a bit trying to make my own. When ever I try to make it as a global, it rages at me if I have more than one, so I went onto trying a static object_list. having a script that counted as an object list for some reason only stored the last item I told it.

Anyways, make it as a global variable. Put your stating value in the place. Now, anytime you need to change the object its referancing, just use (set [global-name] [new-object]) But be warned, when using list_get, it returns them as object, and the only command we have to convert an object into any other thing is (unit [object]) so if your trying to make an object_list of vehicles, you won't be able to use any command that directly looks for a vehicle, only ones that look for objects or units.

I suggest you make the thing you want looped across multiple items a static void script, and then set the object list, then call the static, set the object list, call static, etc, rather than having it try to figure out what object is currently in the list and changing it accordingly.


chrisk123999
Joined: Aug 10, 2008

=CE= Chris [Captain] [=]


Posted: May 6, 2011 08:05 PM    Msg. 8 of 9       
global object_list name "item1 item2 item3 item4 item5"

Edited by chrisk123999 on May 7, 2011 at 09:16 AM


lemarr
Joined: May 6, 2011

Surprisingly, I don't take archery


Posted: May 6, 2011 10:41 PM    Msg. 9 of 9       
Okay, I better make my own thread so that I won't go off-topic.
-Archer1

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 8:38 AM 140 ms.
A Halo Maps Website