Staredit Network

Staredit Network -> Modding Assistance -> Tank Mode <-> Siege Mode
Report, edit, etc...Posted by Rikimbo on 2006-06-18 at 12:45:04
Hey, me again smile.gif

Okay, well I thought the siege tank unit is kind of cool because it is the only unit with an ability that actually changes it's unit ID, to a completely different unit! Now, I know the ID is hard-coded in the ability, so I didn't get too excited of course.

What I'm trying to do is change the Edmund Duke (Siege Tank) and Edmund Duke (Siege Mode) units to something else. More importantly, something else, that doesn't have a turret. For testing I changed both units to be pretty much replicas of Sarah Kerrigan (Ghost). Both units work fine on their own, all attack animations, battle reactions, sounds, and so forth, it all works. But, for both units, clicking on Siege Mode crashes the game, and clicking on Tank Mode crashes the game.

I looked in iscript.bin, and I can't find a header in the siege tank or the siege mode bases that actually does anything for the siege mode order. It looks like the unit is just swapped, and then the rest of the whole 'deploying' is in the siege mode init animation, and the rest must be hard-coded.

Does anyone know how I could avoid crashing the game? Has anyone tried this before?

Any input is appreciated. I'll be trying things in the meantime. I have a hunch that the lack of a turret on the unit might be causing the problems for the hard-coded elements...
Report, edit, etc...Posted by BroodKiller on 2006-06-18 at 13:02:14
Well, this action is hardcoded, because it works like "change this unit into Siege mode" and "change this unit into Tank mode". Two things come to my mind:

!)Reverse-engineer SC and look into this function, get the memory offset where the target-unit ID is located and write a custom ASM action that does the same but with a custom parameter

@)Try this function on other units (not emulated-units, like you did, but completely diofferent units).
Report, edit, etc...Posted by NormMcpetterson on 2006-06-18 at 13:22:13
I dont know if its any help but mabey you could try using a goliath first to find out if its lacking of the turret.
Report, edit, etc...Posted by Rikimbo on 2006-06-18 at 13:54:16
QUOTE(BroodKiller @ Jun 18 2006, 12:01 PM)
!)Reverse-engineer SC and look into this function, get the memory offset where the target-unit ID is located and write a custom ASM action that does the same but with a custom parameter
[right][snapback]508845[/snapback][/right]

Hmm I lack the skill to reverse engineer Starcraft right now... Though I do know some basic ASM... If you tell me a bit more on how I should go about doing that, I could give it a shot. I learn fast, you know.

QUOTE(NormMcpetterson @ Jun 18 2006, 12:21 PM)
I dont know if its any help but mabey you could try using a goliath first to find out if its lacking of the turret.
[right][snapback]508860[/snapback][/right]

That's not a bad idea. I'll try that next time I sit down and work on this.
Report, edit, etc...Posted by nirvanajung on 2006-06-18 at 14:19:12
did u check burrow header in iscript for ur wanted unit
i mean Siege Tank's exchange script is undercontrol by burrow header
Acutally... not Siege tank base it's Siege Tank turret
Report, edit, etc...Posted by BroodKiller on 2006-06-18 at 14:24:36
QUOTE(Rikimbo @ Jun 18 2006, 07:53 PM)
Hmm I lack the skill to reverse engineer Starcraft right now...  Though I do know some basic ASM...  If you tell me a bit more on how I should go about doing that, I could give it a shot.  I learn fast, you know.
[right][snapback]508876[/snapback][/right]

That's a question to DoA, not me, mate. Although I did happen to do some Custom ASM back in the days, I'm no longer an EXE-man.
Report, edit, etc...Posted by Rikimbo on 2006-06-18 at 14:55:44
QUOTE(nirvanajung @ Jun 18 2006, 01:18 PM)
did u check burrow header in iscript for ur wanted unit
i mean Siege Tank's exchange script is undercontrol by burrow header
Acutally... not Siege tank base it's Siege Tank turret
[right][snapback]508900[/snapback][/right]

Okay, well, analysing the different tank and tank turret iscript entries, here are my theories...

Tank Mode to Siege Mode
For the tank base, it looks like the game calls Unknown23: This header plays specific frame 12, which is the angle the tank needs to be in for siege mode, and it places an overlay (maybe referring to the .lol file for placement) of the turret. That's right, an overlay. So this is why I think that for the turret, the game calls the turret's death, which is just 'wait 1, end'. Then there's some kind of swap between the two units, and the rest is taken over by the Siege Mode base and Siege Mode turret Init animations.

Siege Mode to Tank Mode
For the siege mode base, it looks like the game calls ConstrctHarvst. For the siege mode turret, the game also calls it's ConstrctHarvst entry. Kind of odd how both have a 'play sound' command... seems like kind of a lazy mistake, if they actually do both play. Then of course, there's the swap again, and the siege tank (in tank mode) spawns at the right angle because of it's creation angle entry in units.dat.

Soooo... for everything to work probably, I think I'm going to have to make sure all iscript entries are there for both the base unit and the turret unit...

Report, edit, etc...Posted by nirvanajung on 2006-06-18 at 22:39:40
ok.. i hope u make chance upon solution
honestly i did skim through ur writing tongue.gif, nevermind just my jest whistling1.gif

ADDITION:
btw... let's think about morph, burrow, and change unit like sg tank and Archon
i'm not sure about these property what is control these functions by iscript or just switching memory

but basically there are same function that is changing to other unit
and as u know.. gived those buttons are linked iscript "order" command if Action is running
in iceCC call to sigorder, there are different orders varriable
between those functions in iscript

morph, united n change (Archons),tank change mode
are all used order 1 but burrow is used 4

i guess order 1 is switch to other unit and swap memories in the memory view
but order 4 is just switch to other unit condition
and it always remember for earlier unit and it could return to origianl unit directly

so, i guess there is the key to solution of the problem
but it's just my guessing i'm not sure exactly what is main key

Actually overaly and turret image is not important
anyhow all unit just controled by Ai,order and varriables

i guess there are way to work as what wanted function

this is my current oppinion
but i didn't look for all over iscript and commands and varriables of memories
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 11:42:08
Ooh, I didn't see the sigorders in the siege tank (siege mode) base. Thanks for pointing that out. I think I can get it to work properly with that now.

BUT, I'm almost positive the turret is important. Because right now I put the turret back onto the unit (and fixed up Kerrigan's images.dat entry so that it pointed to a .lol file for turret placement), and now even though there are no sigorder commands in her iscript orders, the game does not crash when I push the button. I'm almost certain it's because the game is sending iscript calls directly to the turret unit. It just doesn't work properly right now, because of the lack of 'sigorder 1' in Kerrigan's iscript orders, as you said. What it actually does right now is a bit weird, so I won't explain it all here. But it doesn't crash! happy.gif

Thanks for the input on the sigorder 1; I think you are right, that that is the key to the swapping of the units. If I add that in there, I will probably get it to work now.

And check it out! It's Kerrigan with a tank top! biggrin.gif
user posted image

Once I do get this working, I'll try to remove the turret and see if I can get it working without it. Maybe you are right. We will see, hehe.

EDIT: Alright, got it to work properly by adding 'sigorder 1' at two places in Kerrigan's headers. Going to try to remove the turret now...
Report, edit, etc...Posted by nirvanajung on 2006-06-19 at 12:11:29
fine... but i mean important is not relation to crash
i said about mechanical behavior
that is important matter though if used turret is problem
offcasue if turret not match frames with base then will be crash
that is just option of image every unit not used turret if have mental vision is broad
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 12:15:47
Actually the game has no problem if the turret frames don't match the base unit frames. The game only crashes with frame mismatches for overlays or underlays that have 'followmaingraphic' (like shadows), as far as I know.

Thanks alot for the sigorder tip though, that really was the key to making it work, as you said.

However, the turret needs to be there. I removed the turret and the game went back to crashing as soon as you click the button.

Thanks alot, nirvanajung! You've been a great help. biggrin.gif
Report, edit, etc...Posted by nirvanajung on 2006-06-19 at 12:25:59
i mean about animation played frames not frames count
and if u remove turret then u might need to edit all base images and overlay opitons
realate to all that tanks

try have mental vision is broad don't work in the short view
Report, edit, etc...Posted by DiscipleOfAdun on 2006-06-19 at 12:32:57
Srry, I've been gone. Incase you didn't get it yet, siege mode/tank mode is hardcoded to require a turret. A good bet for your situation is to create an invisible turret, that way it doesn't look too out of place.
Report, edit, etc...Posted by nirvanajung on 2006-06-19 at 12:52:09
dude...then i think u might need to kind of use fake n trick such as using mask
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 13:45:16
QUOTE(DiscipleOfAdun @ Jun 19 2006, 11:32 AM)
Srry, I've been gone.  Incase you didn't get it yet, siege mode/tank mode is hardcoded to require a turret.  A good bet for your situation is to create an invisible turret, that way it doesn't look too out of place.
[right][snapback]509475[/snapback][/right]

AHA! I knew it!

Way ahead of you on the invisible turret thing though -- I've already got a working invisible turret graphic that works for both siege mode and tank mode, so that I only have to waste on flingy.dat entry for both (and one sprites.dat, images.dat, and iscript.bin entry, I guess.)

I'm also going to exploit the fact that both the turret and base units can have attacks and different cooldown rates to do some pretty neat things with this invisible turret, hehe. Who says I can't have my fun with it, eh? wink.gif
Report, edit, etc...Posted by BroodKiller on 2006-06-19 at 14:12:46
Man, this sounds DAMN good smile.gif

What bothers me however, is that you included the sigorder opcode to make this non-crashable but the original animation doesn't need one to be non-crashable. How is that posible?
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 14:46:32
QUOTE(BroodKiller @ Jun 19 2006, 01:12 PM)
What bothers me however, is that you included the sigorder opcode to make this non-crashable but the original animation doesn't need one to be non-crashable. How is that posible?
[right][snapback]509503[/snapback][/right]

To make it not crash, I added the turret. To make it work properly I added the sigorder opcode, so that it does the swap of the units correctly. Without the sigorder opcodes, it didn't crash, but it didn't perform the switch between the units correctly. Well, for one way it never swapped the units, and for the other way it did swap the unit, but the unit was never 'activated', if that makes sense -- that is, the unit was never let free for the user to order around again. It was weird.

For anyone who is interested in this topic, I have everything working properly now. Right now the siege mode button makes the unit swap back and forth between ID 23 and ID 25. There's no delay in the swap either, like the siege tank did. It's click-swap. Pretty cool, if you ask me. happy.gif

Right now both units pretty much do the same thing in my version -- in fact they both use the same base and (invisible) turret graphics. I just haven't gotten around to making both units be distinct and do cool things yet. One thing at a time, hehe.
Report, edit, etc...Posted by BroodKiller on 2006-06-19 at 15:22:26
This is a great feature, if you ask me. I once wondered if this was possible but after some initial 10 crashes I gave it up. This is DAMN cool smile.gif
Report, edit, etc...Posted by Doodle77(MM) on 2006-06-19 at 15:47:20
I'm going to look into the unit ID's. i wanna make it so you can make the devourer switch into a guardian and back smile.gif
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 17:36:43
QUOTE(Doodle77(MM) @ Jun 19 2006, 02:46 PM)
I'm going to look into the unit ID's. i wanna make it so you can make the devourer switch into a guardian and back smile.gif
[right][snapback]509572[/snapback][/right]

I thought about a ground unit that could switch to an air unit too, using the siege mode/tank mode thing. But the thing is, if the air unit is over water or a cliff and you hit the button to transform it back to ground again, my bet is the game will crash. I can't be sure of that though. The only way to find out what happens is to try it then, hehe. Go for it. happy.gif
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-06-19 at 18:44:46
he/she was referring to a air unit mutation, not ground units/air units...

I don't see any problems with that, but none of the current modding programs will support that change disgust.gif
Report, edit, etc...Posted by Rikimbo on 2006-06-19 at 19:01:26
QUOTE(TERRAINFIGHTER @ Jun 19 2006, 05:44 PM)
he/she was referring to a air unit mutation, not ground units/air units...
[right][snapback]509708[/snapback][/right]

Ohhhhhh Devourer, haha, ooops. I read Defiler, for some reason. I thought this fellow wanted to transform Defiler <-> Guardian. No wonder it sounded weird, haha. My bad. Sorry.

But yeah, using this siege mode/tank mode thing, you could probably make the Devourer 'morph' back and forth between Guardian and Devourer. You could even work the iscript so that it looks like it's in the cocoon for a while. The only thing is that you might have to do it over the siege tank or edmund duke IDs. Unless, like you were suggesting, it works for other IDs.

That's a pretty neat idea, too. Try it and let me know how it turns out.
Report, edit, etc...Posted by nirvanajung on 2006-06-19 at 20:31:12
fine...Anyway don't forget that i already gave key to solution of problem whistling1.gif
As i said, try referring to morph, burrow, and change unit like sg tank and Archon
then that would help precious sight more than

Actually overaly and turret image is not important relation to crash
anyhow all unit just controled by Ai,order and varriables

offcasue if turret not match frames with base in animation played frames
then will be crash
that is just option of image every unit not used turret if have broad-mental vision
Report, edit, etc...Posted by Rikimbo on 2006-06-20 at 20:00:58
Whoa.... for those who are still interested in this exploiting siege mode/tank mode to swap unit IDs, I have something even kewler to report!

If you have a ground unit for your tank mode unit and an air unit for your siege mode unit (or the other way around, it doesn't really matter), and you go from air to ground while over a cliff or unpassable terrain, here is what happens: The unit of course becomes the ground unit again, but the game has no problem with it being on unpassable terrain. That is, it does not crash. What does happen is that the unit begins to run around like a chicken with it's head cut off, probably trying to find passable terrain. The unit doesn't respond to move orders, but will turn back to tank mode/siege mode to turn back to the flying unit if you push the button -- getting you out of this mess.

Kind of cool, huh? wink.gif
Report, edit, etc...Posted by nirvanajung on 2006-06-21 at 03:55:01
cool...? hmmm.... why change to ground ? what is merit that for ?
just keep flying then that passable everywhere tongue.gif
offcuase i know that is useful if would creat unit with each different
conditions of wepons and other Actions target such as flying marines by rocket or glider
but that need to consider the HP for changed unit to keep prior state of HP
if used different unit ID
Next Page (1)