Staredit Network > Forums > Modding Assistance > Topic: Making a Nexus attack
Making a Nexus attack
Mar 8 2026, 9:50 am
By: NimoStar  

Mar 8 2026, 9:50 am NimoStar Post #1



The Terran Command Center lifts off and has Comsat Station and Nukes
And Zerg Hatchery evolves two times, researches four upgrades (three for overlord + burrow), produces larva, creep, and indirectly all units

While the Nexus... makes probes. That's all it does.

I wanted to make the Nexus be able to attack air at least, to give it come utility

So, here's what I did:
* Custom weapon
* Assign it as second weapon
* Commands change (make it like Missile Turret)
* Add auto attack to unit properties
* ...And then, I edited the iscript

Yet the game still crashes whenever it would attack



My belief is there is something wrong with the iscript, since if it would not attempt to attack it would not crash?

Then again, no unit/building that can attack can also research or construct. So I'm not sure about the game's limitations in this regard.

Iscript here:

Quote
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 179 Nexus (protoss\nexus.grp)
.headerstart
IsId 177
Type 21
Init NexusInit
Death NexusDeath
GndAttkInit [NONE]
AirAttkInit NexusAirAttkInit
Unused1 [NONE]
GndAttkRpt [NONE]
AirAttkRpt NexusAirAttkInit
CastSpell [NONE]
GndAttkToIdle [NONE]
AirAttkToIdle NexusAirAttkToIdle
Unused2 [NONE]
Walking [NONE]
WalkingToIdle [NONE]
SpecialState1 [NONE]
SpecialState2 [NONE]
AlmostBuilt [NONE]
Built NexusBuilt
Landing [NONE]
LiftOff [NONE]
IsWorking NexusIsWorking
WorkingToIdle NexusIsWorking
WarpIn NexusWarpIn
.headerend
# ----------------------------------------------------------------------------- #

NexusInit:
imgul 182 0 0 # Nexus Shadow (protoss\pneShad.grp)
playfram 0x00 # Frame set 0
goto NexusIsWorking

NexusIsWorking:
wait 125
goto NexusIsWorking

NexusDeath:
playsnd 7 # Misc\ExploLrg.wav
imgol 215 0 0 # Explosion (Large) (thingy\tBangX.grp)
wait 3
lowsprul 224 0 0 # Protoss Building Rubble (Large) (thingy\PRubbleL.grp)
wait 1
end

NexusAirAttkInit:
wait 1
attackwith 2
gotorepeatattk
goto NexusIsWorking

NexusAirAttkToIdle:
playfram 0x00 # Frame set 0
wait 2
goto NexusAirAttkToIdle

NexusBuilt:
imgol 181 0 0 # Nexus Overlay (protoss\pneGlow.grp)
goto NexusIsWorking

NexusWarpIn:
imgol 180 0 0 # Nexus Warp Flash (protoss\nexus.grp)
goto NexusIsWorking

My other idea is the problem being related to the overlay. The Nexus is one of the few structures where the overlay is not completely pointless (since it uses bfire palette which has specific instantiating, such as the nexus lights being more visible in Ice maps), so I will would like to keep it if possible

Post has been edited 2 time(s), last time on Mar 8 2026, 10:06 am by NimoStar.



None.

Mar 8 2026, 10:02 am NimoStar Post #2



Alright! I added some code to the overlay and it works. Looks pretty sweet, too (reused the construction animation for the attack overlay as well so its animated)

Quote
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 181 Nexus Overlay (protoss\pneGlow.grp)
.headerstart
IsId 178
Type 24
Init NexusOverlayInit
Death NexusOverlayDeath
GndAttkInit [NONE]
AirAttkInit NexusOverlayAirAttkInit
Unused1 [NONE]
GndAttkRpt [NONE]
AirAttkRpt NexusOverlayAirAttkInit
CastSpell [NONE]
GndAttkToIdle [NONE]
AirAttkToIdle NexusOverlayInit
Unused2 [NONE]
Walking [NONE]
WalkingToIdle [NONE]
SpecialState1 [NONE]
SpecialState2 [NONE]
AlmostBuilt [NONE]
Built [NONE]
Landing [NONE]
LiftOff [NONE]
IsWorking NexusOverlayAirAttkInit
WorkingToIdle NexusOverlayInit
WarpIn [NONE]
Unused3 [NONE]
StarEditInit [NONE]
Disable NexusOverlayDeath
Burrow [NONE]
.headerend
# ----------------------------------------------------------------------------- #

NexusOverlayInit:
playfram 0x00 # Frame set 0
goto NexusOverlayLocal00

NexusOverlayLocal00:
wait 125
goto NexusOverlayLocal00

NexusOverlayDeath:
wait 1
end

NexusOverlayAirAttkInit:
playfram 1 # Frame set 0, direction 1
wait 1
playfram 2 # Frame set 0, direction 2
wait 1
playfram 3 # Frame set 0, direction 3
wait 1
playfram 4 # Frame set 0, direction 4
wait 1
goto NexusOverlayAirAttkInit

I'd like to do more with Nexus graphics eventually (since Remastered did add a more visible building animation and the Aiur Nexus), but I'm pretty satisfied with this victory so far.

Only need to remember that this code alone will not do if I ever want to add a ground attack, not just or instead of AA.



None.

Mar 14 2026, 6:40 pm NimoStar Post #3



The Nexus needs to have the Script command when default controlled by AI, or the AI will not make probes. This makes it unable to use the Guard script when AI controlled.

This is probably true of all production structures.

However, they will still defend if they are attacked.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
[2026-4-13. : 3:31 pm]
Vrael -- it only costs 50% of my post-tax salary for life and in return I get to also become a drone whose sole purpose is CAPITALISM
[2026-4-13. : 3:30 pm]
Vrael -- pssht, you're still using a phone? I just record 100% of my life using my ElonBrainChip
[2026-4-13. : 2:13 pm]
NudeRaider -- bro I don't go anywhere without my phone to record anything significant
[2026-4-13. : 1:28 pm]
Vrael -- Zoan
Zoan shouted: not if u wer there
id say even if you were there its tricky, human memory can be very faulty
Please log in to shout.


Members Online: Zoan, Excalibur, O)FaRTy1billion[MM], Moose