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.
[08:55 pm]
Vrael -- not really two-party-system specific but it was kinda a big deal when those old guys wrote about "unalienable rights" and that stuff
[08:54 pm]
Vrael -- Oh_Man
Oh_Man shouted: basically i'm saying two party systems sap the violence out of a population by giving them the illusion of choice, instead of feeling the need to rebel, they just say "well i'm not voting for you next time"
you kinda missed those minor details about how fundamental rights are baked into democratic systems so you actually have power to change the system (to whatever degree you wanna argue), whereas in other systems your only option is "no u", aka it's not an illusion of choice
[08:52 pm]
Ultraviolet -- what are you trying to accomplish here?
[08:51 pm]
sraw531 -- similar to how people farm scarabs.
[08:50 pm]
sraw531 -- was toying with the thought of trying to get a computer to continuously make nexi in the corner of the map and have triggers remove it occasionally, but I honestly don't know how to do that.
[08:48 pm]
Ultraviolet -- sraw531
sraw531 shouted: is there a way to create using triggers a building that is under construction? (Especially protoss, for multiple reasons)
afaik this is not possible
[08:46 pm]
sraw531 -- though ~3400 units on map is also an improvement considering reavers are 11 and carriers are 9 units.
[08:45 pm]
sraw531 -- GGmano
GGmano shouted: Yea see it describet as ccmu fix
I think my favorite part about ccmu fix is probably the 400 weapon limit. 100 is so low, considering 10 valks is 80 of that.
[08:41 pm]
Ultraviolet -- Suicidal Insanity
Suicidal Insanity shouted: Ultraviolet The devs are fairly good about backwards compatibility, just sometimes takes time
Fair enough, random crashes are always scary though :P
[07:36 pm]
Suicidal Insanity -- Ultraviolet
Ultraviolet shouted: martosss So you've had issues with maps that were previously playable having issues with the latest patch as well? I was play testing one of my creations a couple days ago and it crashed the game, something it has never done before. Has me feeling kind of concerned about playability of custom content going forward :/
The devs are fairly good about backwards compatibility, just sometimes takes time
Please log in to shout.


Members Online: Marrinanes4y, Roy, Vrael, Ultraviolet, CaptainWill, sraw531, Dem0n, iwabymar