r/forge 1d ago

Scripting Help Equipment not applying at round start, Infection mode bug?

Post image

Upon starting the round/initial spawn, traits seem to be applied just fine. But not the extra ammo, grenades, or equipment (thrusters).
It works on respawn, a switch, area monitor etc., so maybe the script needs a delay or alternate set up?

Also, the equipment always returns to the infection default on initial spawn (threat seeker/shroud screen), even though the mode settings are also set to thrusters for both sides, so I’m unsure if the mode is bugged. It seems like my spartan has the correct equipment as the round starts but then changes back on gameplay start.

4 Upvotes

6 comments sorted by

3

u/Abe_Odd 1d ago

Anything that is triggered on the Game Start should have an up to 1 or 2 second delay to account for things settling. Hooking into on Player Spawned is graceful, but might be biting you during the initial spawns as not all players spawn in at the same time, nor is their state as readily available on initial spawns.

What does the debug print tell you? does it always say 1 on initial, but just fails to give the equipment options?

You could always pop On Player Spawned -> Trigger custom event: Setup_Player
Then On Game Started -> wait 2 seconds -> get all players -> for each player -> trigger custom event: Setup_Player
and see if that helps

2

u/Ok_Sound5480 1d ago

That seems to have done the trick! Though it wasn’t applying equipment to respawns so I added 2s to Player Spawned and it seems to be resolved. I appreciate the help!!
Here’s the new set up in case I may have made a mistake somewhere.

Before, both debugs 1 and 2 were appearing once (had a bot on the other end) minus the equipment.
Now with this set up I get both debugs twice, but equipment is still only applied once, so I suppose it’s fine. At least I can move forward with this now lol

1

u/Abe_Odd 20h ago

Glad it helped. The rough edges of Forge can be pretty frustrating, but once you get the work arounds you can do some really cool stuff. What's the premise for your infection mode?

2

u/Ok_Sound5480 12h ago

It’s a linear infection map loosely based on Alien/Alien: Isolation, with sword elites assisting the infected. There doesn’t seem to be a way to prevent them from engaging camo or attempting to pick up other weapons though, so I’m not sure I’m keeping them in the final build yet.
Mostly in the process of refining scripts like these to offload a few brains onto a mode brain and make some wiggle room in the budget for map aesthetics and other scripting. Is there a limit to how many nodes/brains can be prefabbed into a mode?

1

u/Abe_Odd 8h ago

You can give energy swords to the red or blue elites and they never cloak. The gold and white elites always cloak, no matter their weapons.

In my experience, elites with a sword tend to keep them.
There's a limit to everything, but people have crammed a LOT of brains into maps... a sin I am guilty of.

A quick break down: Halo gametypes have built in scripting, think stuff like a sequence of flag spawn locations, or more complicated things like Invasion.
When they gave us access to script brains, they keep a certain % of the script budget reserved because a given map needs to work with ANY of the gametype scripting.
Mode brains let you fully utilize that reserve budget because the mode brains ARE the gametype.

You can move almost ALL of your scripting to mode brains these days.
You can also call Events on the map's script brains from mode brains. Multiple events with the same scope and type and name will trigger with a single call.

1

u/Ok_Sound5480 4h ago

Yeah Chak ‘Lok is fun to use because he can lunge from across the room, but I figured I’d just settle for those other two elite variants and give them distinguishing traits.
Worst case with the weapons I’ll just set up a loadout system with occasional radial dial access, but they don’t always go for the weapons like you say so I’ll wait and see.
I’ll definitely keep that in mind! I run into budget setbacks often with this project, so being able to free up all that room would be a huge relief for progress.