Staredit Network > Forums > Modding Assistance > Topic: Giving Goliath Base a weapon
Giving Goliath Base a weapon
Apr 10 2014, 3:51 am
By: Pandut  

Apr 10 2014, 3:51 am Pandut Post #1

I'm just a fish

Howdy. I'm working on a little modding project, fairly small to just sharpen my modding ability. I'll likely post the actual thread for the mod after this. Anyway, in this mod I'm making a million and one changes to the existing units in order to make them more useful on the battlefield. One of these changes I'd like to make is turning the Goliath into an incredibly useful multi-use combat unit. Anti-infantry support, anti-air and hopefully a heavier melee counter. With the latter, I was/am aiming to give the Goliath a strong melee attack he uses upon entering melee range since I've disabled his autocannons at that range. The attack is pretty much the Goliath kicking any poor Zergling or Zealot that tries to cop a feel in the face.

At first I thought it was as easy simply giving the Goliath Base a weapon, an attack code in it's Iscript and that'd be that. Buuuut I was horribly wrong. The Goliath does not use the weapon and so I figured if it were that easy someone would've done it before.

Here is my current iscript if it helps;
Code
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 234 Goliath Base (terran\goliath.grp)
.headerstart
IsId               75
Type               23
Init               Goliath_Base_Init
Death             Goliath_Base_Death
GndAttkInit       Goliath_Base_GndAttkInit
AirAttkInit       [NONE]
Unused1           [NONE]
GndAttkRpt         Goliath_Base_GndAttkRpt
AirAttkRpt         [NONE]
CastSpell         [NONE]
GndAttkToIdle     Goliath_Base_GndAttkInit
AirAttkToIdle     [NONE]
Unused2           [NONE]
Walking           Goliath_Base_Walking
WalkingToIdle     Goliath_Base_GndAttkInit
SpecialState1     [NONE]
SpecialState2     [NONE]
AlmostBuilt       [NONE]
Built             [NONE]
Landing           [NONE]
LiftOff           [NONE]
IsWorking         [NONE]
WorkingToIdle     [NONE]
WarpIn             [NONE]
Unused3           [NONE]
StarEditInit       Goliath_Base_StarEditInit
.headerend
# ----------------------------------------------------------------------------- #

Goliath_Base_Init:
    imgul                 236 0 0     # Goliath Shadow (terran\tgoShad.grp)
Goliath_Base_GndAttkInit:
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Local00

Goliath_Base_Local00:
    wait                   125
    goto                   Goliath_Base_Local00

Goliath_Base_Death:
    playsnd               8     # Misc\ExploMed.wav
    imgol                 332 0 0     # Explosion2 (Small) (thingy\tBangS.grp)
    lowsprul               273 0 0     # Terran Building Rubble (Small) (thingy\RubbleS.grp)
    wait                   3
    end

Goliath_Base_GndAttkRpt:
    playfram               0x88     # Frame set 8
    wait                   1
    playfram               0x99     # Frame set 9
    wait                   1
    attackwith             1
    attackmelee           1 894     # Zerg\Ultra\zulHit00.WAV
    playfram               0x00     # Frame set 0
    wait                   1
    playfram               0x88     # Frame set 8
    wait                   1
    playfram               0x99     # Frame set 9
    wait                   1
    gotorepeatattk
    ignorerest
    goto                   Goliath_Base_GndAttkInit

Goliath_Base_Walking:
    move                   6
    wait                   1
    playfram               0x88     # Frame set 8
    move                   3
    wait                   1
    playfram               0x99     # Frame set 9
    move                   3
    wait                   1
    playfram               0x00     # Frame set 0
    move                   3
    wait                   1
    playfram               0x11     # Frame set 1
    move                   5
    wait                   1
    playfram               0x22     # Frame set 2
    move                   5
    wait                   1
    playfram               0x33     # Frame set 3
    move                   4
    wait                   1
    playfram               0x44     # Frame set 4
    move                   8
    wait                   1
    playfram               0x55     # Frame set 5
    move                   6
    wait                   1
    playfram               0x66     # Frame set 6
    move                   4
    wait                   1
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Walking

Goliath_Base_StarEditInit:
    imgol                 235 0 0     # Goliath Turret (terran\goliathT.grp)
    imgul                 236 0 0     # Goliath Shadow (terran\tgoShad.grp)
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Local00


So my question at hand. Is it possible to give the Goliath Base a weapon? Or is it impossible/hardcoded otherwise?



None.

Apr 10 2014, 7:45 am Raygoza Post #2



I think the guys at the burning ground mod might know.



None.

Apr 11 2014, 12:36 am Sand Wraith Post #3

she/her

Code
Goliath_Base_GndAttkRpt:
   playfram               0x88     # Frame set 8
   wait                   1
   playfram               0x99     # Frame set 9
   wait                   1
   #attackwith             1
   attackmelee           1 894     # Zerg\Ultra\zulHit00.WAV # Change the number "1" to the weapon ID that is more approriate.
   playfram               0x00     # Frame set 0
   wait                   1
   playfram               0x88     # Frame set 8
   wait                   1
   playfram               0x99     # Frame set 9
   wait                   1
   gotorepeatattk
   ignorerest
   goto                   Goliath_Base_GndAttkInit


Changes: Removed "attackwith 1". Since you want the Goliath to attack with a melee weapon, attackmelee suffices.

Replace "attackmelee 1" with "attackmelee x" where x is the weapon ID (weapons.dat) of a more appropriate weapon (e.g. "z" where z is the weapon ID of the Zergling -- I don't have actual IDs but you can look them up with DatEdit or whatever). Look up other melee weapon IDs and their properties for an idea as to what is common in between melee weapons. (I don't have any tool access so this is the best help I can provide.)

You can replace 894 with some other sound ID that might be more fitting.

You should use the opcode that has to do with detecting if the target is within a certain range before jumping to another block that has the actual attack to be used.

This may be of interest: http://www.staredit.net/topic/15308/ Scroll down to my third post where the download link is and feel free to open up the EXE of the mod and browse it with an MPQ viewer. If I recall correctly, I left original script code in their for various units.

Of particular interest should be the Goliath, wherein I modified it to have 4 weapons, each of which are fired at different intervals of distance with separate cooldowns and target flags, which appears to be the effect for which you are aiming. Feel free to go through it and use it to your advantage.




Apr 11 2014, 4:15 am Pandut Post #4

I'm just a fish

Ah! Thank you very much, that worked wonders :). Got the goliath to do exactly what I'd like albeit with a few "bugs". It's melee weapon replaces the turret's "1" weapon in the select/command bar thing. Is there a way I can hide it in-game somehow? The goliath also attacks air units with the melee attack despite not have the air target flag checked or air attack codes in the Iscript. Here is the current code;

Code
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 234 Goliath Base (terran\goliath.grp)
.headerstart
IsId               75
Type               23
Init               Goliath_Base_Init
Death             Goliath_Base_Death
GndAttkInit       Goliath_Base_GndAttkInit
AirAttkInit       [NONE]
Unused1           [NONE]
GndAttkRpt         Goliath_Base_GndAttkInit
AirAttkRpt         [NONE]
CastSpell         [NONE]
GndAttkToIdle     Goliath_Base_GndAttkToIdle
AirAttkToIdle     [NONE]
Unused2           [NONE]
Walking           Goliath_Base_Walking
WalkingToIdle     Goliath_Base_GndAttkInit
SpecialState1     [NONE]
SpecialState2     [NONE]
AlmostBuilt       [NONE]
Built             [NONE]
Landing           [NONE]
LiftOff           [NONE]
IsWorking         [NONE]
WorkingToIdle     [NONE]
WarpIn             [NONE]
Unused3           [NONE]
StarEditInit       Goliath_Base_StarEditInit
.headerend
# ----------------------------------------------------------------------------- #

Goliath_Base_Init:
    imgul                 236 0 0     # Goliath Shadow (terran\tgoShad.grp)
Goliath_Base_GndAttkToIdle:
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Local00

Goliath_Base_Local00:
    wait                   125
    goto                   Goliath_Base_Local00

Goliath_Base_Death:
    playsnd               8     # Misc\ExploMed.wav
    imgol                 332 0 0     # Explosion2 (Small) (thingy\tBangS.grp)
    lowsprul               273 0 0     # Terran Building Rubble (Small) (thingy\RubbleS.grp)
    wait                   3
    end

Goliath_Base_GndAttkInit:
    wait                   1
    trgtrangecondjmp       64 Goliath_Base_Local01
    goto                   Goliath_Base_GndAttkToIdle

Goliath_Base_Local01:
    wait                   1
    waitrand               1 3
    playfram               0x88     # Frame set 8
    wait                   2
    playfram               0x99     # Frame set 9
    wait                   2
    attackmelee           1 9     # Misc\ExploSm.wav
    playfram               0x00     # Frame set 0
    wait                   2
    playfram               0x88     # Frame set 8
    wait                   2
    playfram               0x99     # Frame set 9
    wait                   2
    gotorepeatattk
    ignorerest
    goto                   Goliath_Base_GndAttkInit

Goliath_Base_Walking:
    move                   6
    wait                   1
    playfram               0x88     # Frame set 8
    move                   3
    wait                   1
    playfram               0x99     # Frame set 9
    move                   3
    wait                   1
    playfram               0x00     # Frame set 0
    move                   3
    wait                   1
    playfram               0x11     # Frame set 1
    move                   5
    wait                   1
    playfram               0x22     # Frame set 2
    move                   5
    wait                   1
    playfram               0x33     # Frame set 3
    move                   4
    wait                   1
    playfram               0x44     # Frame set 4
    move                   8
    wait                   1
    playfram               0x55     # Frame set 5
    move                   6
    wait                   1
    playfram               0x66     # Frame set 6
    move                   4
    wait                   1
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Walking

Goliath_Base_StarEditInit:
    imgol                 235 0 0     # Goliath Turret (terran\goliathT.grp)
    imgul                 236 0 0     # Goliath Shadow (terran\tgoShad.grp)
    playfram               0x77     # Frame set 7
    goto                   Goliath_Base_Local00




None.

Apr 11 2014, 7:52 am Sand Wraith Post #5

she/her

Try setting any air attack-relevant animations to the Goliath_Base_GndAttkToIdle block.

Not sure what you mean by the command bar thing. Do you mean where it displays the weapon and armour icons? That status bar can only display up to 4 or 5 icons I think, so you'll probably have to prevent the Goliath's armour icon from appearing.




Apr 12 2014, 12:11 am Pandut Post #6

I'm just a fish

Aye yeah, the in-game armor and weapon icons. How would I go about modifying that? If anything, I'd just like to hide the melee weapon icon.

I altered the code to have the AirAttack relevant bits to use GndAttkToIdle however they kept reverting to AirAttkToIdle whenever I saved. So I made a dummy AirAttkInit that went to GndAttkToIdle which worked. The Goliath no longer attacks air units with the melee weapon. All that is left is the icon. Thank you kindly for your help so far :).



None.

Apr 14 2014, 3:03 am Sand Wraith Post #7

she/her

With respect to the GndAttkToIdle thing: I meant something like this in the headers:
Code
GndAttkInit       Goliath_Base_GndAttkInit
AirAttkInit       Goliath_Base_GndAttkToIdle
...
GndAttkToIdle     Goliath_Base_GndAttkToIdle
AirAttkToIdle     Goliath_Base_GndAttkToIdle

but it sounds like you got it on your own.

I don't remember the exact fields that you need to check in order to prevent certain icons from appearing. Look at the armour data entry for buildings and compare the upgrades.dat and stuff with a normal unit. (Since buildings normally don't have an armour icon, you can try looking for it as a difference between it and normal armours and weapons.)

You're welcome~ :3




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[04:31 pm]
Zoan -- where's the option to delete my account
[04:30 pm]
Zoan -- goodbye forever
[04:30 pm]
Zoan -- it's over, I've misclicked my top right magic box spot
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are almost 3k pages
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- the real members stop around page 250
[2024-4-14. : 9:20 pm]
O)FaRTy1billion[MM] -- look at the members list
[2024-4-12. : 12:52 pm]
Oh_Man -- da real donwano
da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
it's pretty common
[2024-4-11. : 9:53 pm]
da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
Please log in to shout.


Members Online: jjf28