I'm trying to make a mini-game based on targets where when a target is destroyed, it increments the team score by one. So I had the target scripted so that when Destroyed/Despawned>Message Send: Whiskey or whatever. And a neutral team script brain set that on Message Recieved: Whiskey>Increment Team Score by 5. This basic setup worked after a tweak to make sure the script only incremented by one. Then I went to work on another similar aspect of the mini-game and restarted the game after saving to reset my score (after trying and failing to make a reset target by setting the player's score to 0). Then I noticed my script no longer increased the score. After restarting again, rebuilding the script from scratch, and even rebooting the game and trying a different canvas I can't get this to work again. What did I change to break the initial script, and/or what am I forgetting to change that means subsequent tries don't work? I tried looking for tutorials but none of the ones available that I saw are close enough to be applied.
Are you changing team score, or player score? Player score won't reflect in the game bar, but team score will, per patch notes... somewhere. EDIT: Found it! Minigame - A simple mode for building your own custom game modes in. Four trait slot options can be setup and triggered with the Forge scripting Options to enable/disable objects minigamebject labeled objects in Forge NOTE: In this mode when playing a Team based game, player scores do not contribute to the team score. This is intentional to allow for a wider variety of custom gameplay experiences. Through scripting it is possible to convert player score into team score though.
It doesn't seem to work with team scoring either, I'd take either until I work on the idea some more.
I had my capture card running when I got this to work for a brief moment. Shooting the targets DID make my score go up in Forge. Then I restarted the session to clear my score and it no longer worked. I repeated what I did step-by-step and it doesn't work so the only thing I can think of is that it was a glitch that it worked. Which begs the question then, what is the *right* way to get destroyed targets to increment your score for a mini-game?
Have you tried simply having the targets increment the score themselves when destroyed, rather than messaging another object to do it?
I've caught myself doubting my scripting abilities on a few occasions, only to eventually realize that I had disabled scripting on the map and forgot. Derp. But try what Starship said, make it so that when it's destroyed it does the score change itself. I think you're going to want to use Team(add) and pick red/blue.
Once it dawned on me that I could I believe I did try it. I'm going to try it one more way as a one item method next time I'm on, then I'm totally at a loss. I never disabled scripting on any level that I saw. Plus starting over from scratch would be scripting was on by default I believe, still didn't work. I'll try it all again when I'm on in a bit.
I was wanting to do something similar with this. Let me tag some of the Scripter's for you. @Egggnog @Agent Zero85 @Captain Punch
The master is here. (ish???) Lol. But in order for me to understand exactly what's wrong, i'd have to join a game with you.
I have not been able to look at the targets my self, but can you not: On interaction: score change: increment Activators score by constant or what ever?
Just looked at it right now, I believe interaction is reserved for buttons/switches because it's not an option for targets. I have it set for When Condition: Destroyed/Despawned, Do Score: Change, Type: Team. Scorers - Operation: Increment, Source: Constant, Value: 10, for example, randomize: off. (There is no option to set this/activators on the target object so it refers to THIS). And options I have Condition and Round Interrupt off with Always Runs on and Enabled on.
Ah-****ing-HA, I finally got it working again when setting the script brain to focus on an individual team and when I have the target send a message and the brain make a score change based off of the activator receiving it. Thing is, I SWEAR the script brain wasn't set for a team before, so I don't know why it worked the first time. Oh well, problem solved for now. Thanks for the advice guys. EDIT: Now I need to figure out how to only increment the score for the team that hits the target. If I'm on blue team and break a target, now red and blue get points.
Having a neutral target recognize the team it was shot by doesn't seem possible without ballistic forensics. So it seems each team would need their own set of targets.
Oh, well if that's true then my gamemode is kinda dead in the water because the idea was to have respawning targets that the teams fight over.
Aw man. Looks like my idea won't work. I misremembered a function of the target... if you can use Number to keep track of which player killed it, that might be a work around
I tried different number settings and could never found one that worked and allowed both teams to independently earn points.