Staredit Network > Forums > Modding Assistance > Topic: Prevent human player seeing own unit without impacting unit AI
Prevent human player seeing own unit without impacting unit AI
May 26 2018, 1:57 am
By: Biophysicist  

May 26 2018, 1:57 am Biophysicist Post #1



I'd like to implement a "jamming field" mechanic. Flavorfully, a jamming field prevents affected units from sending or receiving transmissions; to implement this, I'd like to cut off all vision provided by those units, and prevent the controller from selecting them. However, the affected units must remain as effective as any other unmicroed units; in particular, they must be able to return fire. Additionally, the presence of unjammed friendly units in the area suppresses both effects (since the unjammed units can relay transmissions, and to provide for meaningful counterplay).

Use cases:

a) Player A jams player B's harass outside of A's base. B doesn't get to see any of A's base because of the vision denial. The harass probably dies to B's defenses, but may take a few of A's units with it.
b) Player A notices a push by player B and sets a jamming field in its path. Player B will recognize that their units have been jammed, but doesn't know whether player A actually has anything in the area to engage with.
c) Player A jams player B's units. Unfortunately, A places the jammer too close and B's units autoattack it. The effect ends and B regains normal control of their units.
d) Player A jams player B's units. B, however, has kept a few units in reserve and moves them in. Since they're not jammed, B regains normal control of their units.



If the solution is to give the units to player 12 and code AI for the jammed units manually, that's doable. I'm hoping for a solution that leverages existing code more, so as to minimize inconsistencies (eg. the armor fuckiness in [47]).

This is definitely going to be a GPTP thing.



EDIT: For the purposes of this exercise, supply doesn't exist.

Post has been edited 1 time(s), last time on May 26 2018, 2:03 pm by Biophysicist.



None.

May 26 2018, 7:49 pm Sand Wraith Post #2

she/her

I remember someone developed some code to allow setting a unit's sight to 0. You could probably do that and force deselecting the affected units or something/setting them to be unselectable and either preserve their current orders or order them to stop to allow their standard unit AI to take over.




May 26 2018, 7:50 pm Pr0nogo Post #3



If you get anywhere with setting unit vision to 0, let me know. I've been looking for a solution to that for my own needs.




May 27 2018, 3:35 pm Biophysicist Post #4



After talking with Voy a bit, I've concluded the best option is to dummy out the normal SC attack logic and replace it with my own. Then I can give the jammed units to extended players and not have to worry about SC throwing any edge cases at me.

I don't that helps your use case, though, Pr0.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:46 pm]
Vrael -- NudeRaider
NudeRaider shouted: everyone gets their own message! How thoughtful! :wub:
ill thinkful your message
[2024-10-09. : 7:27 pm]
NudeRaider -- everyone gets their own message! How thoughtful! :wub:
[2024-10-09. : 12:42 pm]
Vrael -- do these guys realize the effort they're putting to advertise to like 15 people?
[2024-10-09. : 12:25 pm]
Zoan -- hard at work for dem minerals
[2024-10-08. : 7:53 pm]
Zoan -- I'm in Georgia; somehow it seems to have been a lot worse for you guys even though you're all more north
[2024-10-08. : 7:52 pm]
Zoan -- Ultraviolet
Ultraviolet shouted: My town right now (a few days ago at this point). It's crazy here, day 12 with no power or running water.
daaaang man
[2024-10-08. : 6:40 pm]
Ultraviolet -- My town right now (a few days ago at this point). It's crazy here, day 12 with no power or running water.
[2024-10-07. : 11:00 pm]
Oh_Man -- https://youtu.be/h6ORd1FA6V8 we saved the gays (this map was exceedingly korean)
[2024-10-07. : 3:18 pm]
Zoan -- Oh_Man
Oh_Man shouted: and then he replaced every time i said free will or the self with "gubble gubble gubble" XD
lool
[2024-10-06. : 3:32 pm]
Vrael -- everyone knows that
Please log in to shout.


Members Online: Ultraviolet, Vrael