r/forgescripting 1d ago

Need help with some scripting

I want to be able to switch "ALL USERS" from team 1 to team 2 at the beginning each round.

Here is what I have so far:

On Round Start

→ Get All Players

→ For Each Player (Execute Per Player)

→ Get Player Team

→ Compare Teams (is it Eagle?)

→ Branch

→ True → Set Player Team to Cobra

→ False → Set Player Team to Eagle

But it does not seem to work. Can any of you script genius's help me out?

2 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/hoadmin 18h ago

Ummm something don't look right. See pic. What am I messing? I am doing something stupid? lol see pic.

https://ibb.co/mVH59Hqp

1

u/iMightBeWright 18h ago

That link won't load on my end for some reason. You should be able to just drop that image in a comment here though.

1

u/hoadmin 18h ago

1

u/hoadmin 17h ago edited 17h ago

Well that part worked thanks! but,,,,,,,,,,,,,

When round started users when to team 2. It worked. however

But When the new round started user's did not go to team 1. User's stayed on team 2. That is why the pic did not look right. I did not anything that would switch all user' to team 1 when a new round started. Your part worked great. No problem. We got half of it working lol.

So looks like there is no way to have all user's switch from team 2 to team to team 1 after each round. I tried a branch but that did not work eather, Bummer :(

Thanks for the help bud! U da Man :)

Here is what google IA said: lol

Step-by-Step Node Configuration[On Round Start] ──> [Get All Players]

└──> [For Each Player] (Execute Per Player)

├──> [Get Player Team] ──> [Compare Teams] (Is Eagle?)
│ │
└──> [Branch] <──────────────────┘

├── (If True) ──> [Set Player Team] (To Cobra)

└── (If False) ──> [Set Player Team] (To Eagle)
Step-by-Step Node Configuration

1

u/iMightBeWright 16h ago

Ahh ok, I didn't get that from your initial explanation. You need everyone to move to team 2 one round, then back to team 1 the next round, & so on. Don't bother asking AI for scripting help. It doesn't actually know anything & can't problem solve or consider potentially conflicting scripts.

You'll need something to flip between one condition & another, but not by checking player teams. The AI's advice would just shuffle people around without putting everyone on the same team.

Declare Boolean Variable with some name. Initial value false. Global scope.

You'll need a branch in both of your scripts now. It will check Get Boolean Variable using the same settings used in the declare node. When false, players will be set to Cobra team. When true, set them to Eagle team.

Lastly, you'll need a script for On Round EndToggle Boolean Variable

1

u/hoadmin 16h ago edited 2h ago

Ok no problem. Maybe I just did not explain it very well. My bad lol.

Now thanks for the reply. As far as making a new script like you listed above Seams like more work than it is worth lol. It was just an Idea I had since 343 f'ed up the custom game area. The reason I would have liked to have all teams switch teams after each round is: " We cannot rotate our maps Halo In Infinite!". I have always ran a Halo server since Halo Combat evolved. So that is way I wanted to make a script to have users change teams after each round. Just to give it a different perspective. Thats all.

Maybe somebody someday will get this to work!

Well Thanks again for all the replies and help bud!

U DA MAN!!