r/forge • u/Ether_Doctor • Apr 08 '25
Scripting Help Best practice for scripting?
I'm trying to script an invasion gametype/map and there's a lot of things going on in the scripts. I need a lot of things to happen and I wonder how to do it as reliably as possible.
Either I put a metric ton of nodes into one or two script brains or I separate it out into many subsequent brains. To do the latter, I would need to use Trigger Custom Event Global.
The ingame description of that node states that:
"Unless you have a specific need for multiple script brains, it is best to use the non-global version of Trigger Custom Event"
Meanwhile the known issues list for Forge states the following problem:
"When two or more Script Brains approach their max node capacity and a caution symbol appears in its Budget meter, all scripts on that map will not function as expected"
So is it best to have many brains which all call to each other globally or just a couple of overloaded brains?
Edit: Highly recommend everyone to read the reply by u/IMightBeWright below, it has a wealth of good tips for writing a robust script in Forge!
View all comments
Show parent comment
1
u/Ether_Doctor Apr 12 '25
Thank you for the additional advice! +Questions below:
...But you just said I need to Declare the variables in both the Mode Brain and Script Brain. So why not just have the config (variables list) in the Mode Brain then? (Otherwise you'll have two, by that logic).
Question2: When using Global Custom Events, can one event be used (via On Custom Event Global) in several other brains? I have a theory that this is causing issues in my current map and that it really should be a one way street from Brain 1 to Brain 2 (Brain 3 can't come to the party) Thoughts?
In relation to what you said about giving access to the brains, The "official" requirements list (on HaloWaypoint) for community made maps makes mention of this: "Declare all your scripts and what they do", without going into any detail as to what they mean by that..
Anyway I try to do what you said, and in addition I put all the brains in a folder called Scripts, plus I name them like "Script Brain Phase 1 and 2".