Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Xindaris on September 29, 2020, 12:59:33 PM

Title: Make a core player-selectable
Post by: Xindaris on September 29, 2020, 12:59:33 PM
I have a core that requests ammo from the player to do something. If possible, I'd like the player (with generally the default interface) to be able to select the core as a unit and tell it to "stop resupply" just like you can with regular player units. I can't find any simple utility to do that; is there a good example of this sort of function I could read up on to try and figure out a way to do it?
Title: Re: Make a core player-selectable
Post by: GoodMorning on September 29, 2020, 08:58:03 PM
The short answer is "no".
The long answer is "we've been looking at this kind of thing for years, and nobody's found a good way to do it without heavyweight scripting".
The middling answer is "haha, nope".

I'd suggest allowing the player to toggle it by clicking or double-clicking, if it's just one unit.
Title: Re: Make a core player-selectable
Post by: Xindaris on September 30, 2020, 12:32:45 AM
Eh...to be honest, I've warmed up to the idea of having the core constantly requesting packets just be a thing the player has to deal with in this map. It should be easy enough for them to destroy/disable relays and collectors within range of it. But thanks for your response anyway, as that gives me the confidence that it'd be too much trouble to try to work the other way anyway.
Title: Re: Make a core player-selectable
Post by: cornucanis on September 30, 2020, 03:12:32 AM
Here's an example (https://pastebin.com/NfqRk8de) of some selection code I've reused a few times. This is originally from an AC bertha unit, I tried to remove most of the irrelevant stuff but I left some of it in to give an idea of how it's meant to flow. It may also be missing a few pieces since I snipped it from the larger script, but this should at least give you an idea of how to generally structure things if you do decide to go down this route.