Staredit Network

Staredit Network -> Concepts -> TRIGGERS OF GOD
Report, edit, etc...Posted by Doodle77(MM) on 2005-07-28 at 14:34:48
QUOTE(Doodle77 @ Jul 28 2005, 01:19 PM)
Starforge crashes when i put in something like -65284(which i needed to do for zerg flyer carpace and attack) how do i get around this. i could use a hex editor but i dont like them.
[right][snapback]272639[/snapback][/right]

come on, someone answer my question, and if dk was the one answeringmy post, i used you converter thingy to get that number
Report, edit, etc...Posted by Blu on 2005-07-28 at 14:36:37
Hey Krazy, wondering if u can make these kinda units:

SCV that builds PROTOSS units
Ling With Stim yawn.gif
Zealot with High Templar Abilities

oh and, u cant have more than one custom unit in a game (unlesss someone else knows how)
Report, edit, etc...Posted by Voyager7456(MM) on 2005-07-28 at 14:39:22
Oh, dang... 28 is reserved? That means no altering P1's infantry armor through triggers. blushing.gif
Report, edit, etc...Posted by Deathknight on 2005-07-28 at 14:48:22
UED, The players only go from 0-255. 0 being player 1. I tried that "method" carl posted, but it doesn't work. The range comes from a calculation which should be 513874 to 813944.*

ADDITION:
QUOTE
come on, someone answer my question, and if dk was the one answeringmy post, i used you converter thingy to get that number

No you didn't. I don't know where you got that number.

QUOTE
SCV that builds PROTOSS units
Ling With Stim
Zealot with High Templar Abilities

oh and, u cant have more than one custom unit in a game (unlesss someone else knows how)

You can have infinite and it's totally possible to make that all happen.

Report, edit, etc...Posted by UED77 on 2005-07-28 at 14:48:55
Players go from 0-255? Darn. But then why are there 4 bytes in the TRIG section for specifying the player? sad.gif

I see. Okay. Thanks for clearing this up.

UED77
Report, edit, etc...Posted by DT_Battlekruser on 2005-07-28 at 14:49:49
QUOTE(Voyager7456(MM) @ Jul 28 2005, 06:43 AM)
So... with this graphics changing thing, which unit gets it's graphics changed? The first one placed, the 2nd one placed or none of the above? Because I'm working on a small map that demonstrates all of these concepts...
[right][snapback]272484[/snapback][/right]


Changing the setting for a unit affects ALL placed unit of that unit type.

Chaning the Marine graphic affects all current and future marines.

QUOTE(JohnnyHazardous @ Jul 28 2005, 08:23 AM)
This is like turning SC mapping into Wc3 mapping.
[right][snapback]272548[/snapback][/right]


Better. War3 mapping can't resize in game or do ANY of this stuff in-game.

Updated memcalc so it won't take of 65536 if the UID is <32767.

Remeber, memcalc is only for converting offsets inside the range of death counters.
Report, edit, etc...Posted by Voyager7456(MM) on 2005-07-28 at 14:51:55
QUOTE(DT_Battlekruser @ Jul 28 2005, 12:49 PM)


Updated memcalc so it won't take of 65535 if the UID is <32767.

Remeber, memcalc is only for converting offsets inside the range of death counters.

[right][snapback]272722[/snapback][/right]


That should clear up some confusion... what happens if I put in an offset that is outside the range of death counters? Will I get an error?
Report, edit, etc...Posted by Blu on 2005-07-28 at 14:55:02
oh btw i used that test map and this is what weird stuff i got

Venom = 20 damage ????

Weird face appeared on the building when my wraith had vulcan cannon from siedged tank. Looked like a mix between civilian and science vessel yawn.gif he was tan too yawn.gif

Norad II = 0 damage
Level 2 Science Facility = 5k damage sick.gif
Report, edit, etc...Posted by l)ark_13 on 2005-07-28 at 14:55:09
QUOTE(Blu @ Jul 28 2005, 11:36 AM)
Hey Krazy, wondering if u can make these kinda units:

SCV that builds PROTOSS units
Ling With Stim yawn.gif
Zealot with High Templar Abilities

oh and, u cant have more than one custom unit in a game (unlesss someone else knows how)
[right][snapback]272706[/snapback][/right]


Well, right now you cant really get that with the graphic changing triggs. But like DK said its all very possible and probably will be in the future.
(You can try to change the graphic of unit to a probe or w/e and you have the ability to build buildings, but then when you try you cant.)
Report, edit, etc...Posted by Blu on 2005-07-28 at 15:05:39
EDIT: OMFG I THINK I FOUND A NEW UNIT *or something*
Look at attachment! ! !

(Note: Hes in the unit display, below the menu(f10) button)
Report, edit, etc...Posted by Deathknight on 2005-07-28 at 15:08:12
Um.. that's a regular unit portrait...
Report, edit, etc...Posted by UED77 on 2005-07-28 at 15:11:14
You merely changed the portrait of the Refinery from #17 to #61, Blu.

It's not a new unit; the existence of this portrait has been known for quite some time.

UED77
Report, edit, etc...Posted by Blu on 2005-07-28 at 15:11:27
oh :/ never seen this face thou, thought it was a hidden unit or something :/ what unit is it anyways?
Report, edit, etc...Posted by DT_Battlekruser on 2005-07-28 at 15:12:49
TUTORIAL ON MEMORY EDITING THROUGH TRIGGERS

REFERENCE LISTS
MEMORY OFFSETS
CODE
Flingy.dat
Sprite – 645540  Size=2 bytes per entry, pointer to Sprites.dat
TurnStyle – 645048 Size=2
Acceleration – 6451fc Size=4
TurnRadius – 645bd0 Size=1
Unknown – 6456e4 Size=1
MoveControl – 6457b8 Size=1

Sprites.dat
Image – 696914 Size=2, pointer to images.dat
Hp Bar Length – 6972b4 size=1 387 entires
Unknown 1 - 696d20 size=1
Unknown 2 – 6970ac size=1
Selection circle image – 69678c size=1 387 entires
Selection circle vertical offset – 696f28 size=1 387 entires

Orders.dat
Label – 65d690 who cares, it never shows up in game
Flag1 – 65df88 All flags are 1
Flag2 – 65d80c
Flag3 – 65d090
Flag4 – 65de08
Flag5 – 65d2d0
Flag6 – 65d8cc
Flag7 – 65da4c
Flag8 – 65d510
Flag9 – 65dd48
Flag10 – 65d450
Flag11- 65d5d0
Flag12 – 65d98c
Weapon – 65d390 size=1 pointer to weapons.dat
Technology – 65cfd0 size=1 pointer to Techdata.dat?
Type – 65dec8 size=1
Group – 65db0c size=2
Unknown – 65d150 size=2
Emulate – 65dc88 size=1

Units.dat
Graphic – 6b8ec8 size=1 pointer to flingy.dat
Subunit 1 – 6b7570 size=2
Subunit 2 – 6b71e0 size=2
Subunit 3/Overlay – 6b83b0 size=2, don't edit ever, deals with infested CC
Construction Animation – 6b7bac size=4
Subunit Turning(A3 Unknown1) – 6b8c64 size=1
Shield Enable – 6b673c size=1
Shield Amount – 6b871c size=2
Hit Points – 6b6904 size=4
Animation Level – 6badd4 size=1
Movement Type – 6bab28 size=1
Staredit Order/Label – 6b6f34 size=1
Action Comp AI – 6b9174 size=1
Action Human AI – 6b6e50 size=1
Action Unknown – 6ba324 size=1
Action Attack Unit – 6b7ac8 size=1
Action Attack Move – 6b6d6c size=1
Weapon Ground Attack – 6b8fac size=1 pointer to weapons.dat
Max hit ground – 6b9400 size=1
Weapon Air Attack – 6b8638 size=1 pointer to weapons.dat
Max hit air – 6b6820 size=1
Unknown 2 – 6b6584 size=1
Special Ability Flags – 6baeb8 size = 4  You know what is here. :)
Subunit Attack Range – 6b9a3c size=1
Sight Range – 6bacf0 size=1 can never go above 11(decimal)
Armor Upgrade Group – 6bac0c size=1
Size – 6b88e4 size=1
Armor Amount – 6b9090 size=1
Unknown 3 – 6b7738 size=1
Ready Sound – 6b6668 size=2 pointer to sfxdata.dat 106 entires
What Sound Start – 6b8020 size=2
What sound end – 6b73a8 size=2
Annoyed Sound Start – 6b6c98 size=2 106 entires
Annoyed sound end – 6b9258 size=2 106 entires
Yes sound Start – 6b932c size=2 106 entries
Yes sound end – 6b8b90 size=2 106 entries
Unknown 4(This are the values(2) that Unit Resizer Changes) – 6b94e4 size = 2, there are 2 entryies per unit, an x value, and then a y value.
Unknown 5 – 6b8d48 size=2, 192 entires
Dimensions(These 4 deal with if a spirte is played over a unit) – 6ba408 size=2 with 4 per unit.  Description at bottom.
Portrait – 6b81e8 size=2 pointer to portdata.dat
Mineral Cost – 6b781c size=2
Vespene Cost – 6b9b20 size=2
Build Time – 6b8470 size=2
Restriction Flags – 6b89c8 size=2
Staredit Group Flags – 6b9eb0 size=2
Food Produced – 6b7f3c size=1
Food Cost – 6b64a0 size=1
Space Required – 6b70fc size=1
Transport Space – 6b79e4 size=1
Build Score – 6b9f94 size=2
Destroy Score – 6ba15c size=2
Unknown 8(This is the String referencer.  It will change the name of the unit to that string in the map) – 6b9ce8 size=2
Broodwar Unit Flag – 6b7018 size=1
Staredit Available – 6b9874 size=2


Images.dat
File – 64ca58 size=4 pointer to images.tbl
GFX Turns – 655ac4 size=1
Shadow Turns – 652bec size=1
Unknown – 652bec size=1
Floats – 6552f4 size=1
Palette Type – 65f40c size=1
Palette Special – 64d9f8 size=1
Iscript ID – 64ed7c size=4
Shield Overlay – 64dde0 size=4
Overlay2 – 651c50 size=4
Overlay3 – 64fd18 size=4
Overlay4 – 650cb4 size=4
Overlay5 – 652fd4 size=4
Overlay6 – 653f70 size=4

Techdata.dat
Mineral Cost – 6aa0b0 size=2
Vespene Cost – 6aa164 size=2
Research Time – 6aa26c size=2
Mana Required – 6aa10c size=2
Unknown 1 – 6aa2f0 size=2
Unknown 2 – 6aa058 size=2
Icon – 6aa1bc size=2
Label – 6aa214 size=2
Race – 6aa2c4 size=1
Research Flag – 6aa1e8 size=1
BroodWar Flag – 6aa1bc size=1

Upgrades.dat
Mineral Cost Base – 6bb53c size=2
Mineral Cost Factor – 6bb404 size=2
Vespene Cost Base – 6bb4c0 size=2
Vespene Cost Factor – 6bb388 size=2
Research Time Base – 6bb6f0 size=2
Research Time Factor – 6bb5b8 size=2
Unknown 1 – 6bb24c size=2
Icon – 6bb30c size=2
Label – 6bb674 size=2
Race – 6bb480 size=1
Repeats – 6bb2c8 size=1
BroodWar Flag – 6bb634 size=1

Weapons.dat
Status Bar label – 6bc7b4 size=2
Missile Sprite – 6bbe04 size=4
Special Attack – 6bbaf4 size=1
Attack Type – 6bcac4 size=2
Minimum Range – 6bbb78 size=4
Maximum Range – 6bc5ac size=4
Upgrade Group – 6bc4a4 size=1
Weapon Type – 6bc8b8 size=1
Weapon Behavior – 6bca40 size=1
Missile Type – 6bc528 size=1
Explosion Type – 6bcccc size=1
Splash Value 1 – 6bb9f0 size=2
Splash Value 2 – 6bb868 size=2
Splash Value 3 – 6bc00c size=2
Damage Amount – 6bc93c size=2
Damage Bonus – 6bc214 size=2
Cooldown delay – 6bbd80 size=1, can never be 0
Damage Factor – 6bb96c size=1
Coord x1 – 6bcd50 size=1
Coord x2 – 6bc420 size=1
Coord y1 – 6bc39c size=1
Coord y2 – 6bc318 size=1
Targeting Error Message – 6bc110 size=2
Icon – 6bcbc8 size=2

Units.dat dimesions variable has 4 entries per unit.  Imagine a coordinage grid over a unit, with 0,0 at the center.  The first value is a negative x value for when a unit cannot pass over the sprite.  The second is a positive y, 3rd positive x, 4th neg y.  If they are all set to 0, any unit can walk over that unit.


INTRODUCTION

What are we doing here?
Using these obscenely huge number in the death count triggers, we are actually modifying the memory of Starcraft. The "memory offsets" of all the properties in all the .dat files are shown above.

HUH?!?
Each death counter is stored as a 4-byte long. In binary, it looks like this:

00000000 00000000 00000000 00000000

For simplicity, I will use hexedecimal (base 16) to represent the bytes. In hex, the bytes look like this:

00 00 00 00

Each death counter correpsonds to a value using the offsets above. Using my Memory Calculator, we can tell which deaths of which unit the offsets correspond to.

Now lets start simple.
Let's say we want to do something very simple, say give a Ghost shields. If we look under units.dat in the reference list, we see this line:
CODE
Shield Enable – 6b673c size=1

This means that at the offset 6B673C is where the shield toggle is. It also says that the data for it is only 1 byte long.

oooookayyy...
Next, we want to use the Memory Calculator to find what death count the offset corresponds to. Plug in the memory offset 6b673c. MemCalc returns this:

QUOTE
To achieve this offset, use Unit ID -29788 with player 3 on byte no 1


The deaths of unit -29788 for Player 3 is a 4-byte long like this. But since the shield toggle only uses 1 byte, the first element in the shield toggle is what's highlighted below.


00 00 00 00

The first value set is for Unit ID 0, the Terran Marine. The Ghost, which we wish to modify, has a Unit ID of 1. Therefore we go 1*1 (1) bytes along to get the the value that is the shield toggle of the Ghost. It is highlighted here:

DEATHS OF -29788 FOR PLAYER 3:

00
00 00 00

For a shield toggle, a byte value of 00 means no shields, while any other value enables them. However, when we add deaths, we're adding a number to the full 4-byte long so we have to be careful. We want to add the hexedecimal number 100
so that we add 1 to the second byte, but leave the first untouched. The math is shown here, the byte we wish to change highlighted.

DEATHS OF -29788 FOR PLAYER 3:

00
00 00 00

+00
01 00 00

=00
01 00 00

100 in hexedecimal is 256 in decimal, so you add 256 to the death count. This changes byte 2 to 01 and enables shields on the ghost. Your trigger would look like this:

SetDeaths(P3,Setto,256,-29788);

But Starforge won't let me input the number!
Use the custom .lst files provided by Deathknight so you can trigger this way.

Where can I go from here?
You can do the same process for any value, but keep in mind that if the size is, say, 2, then each unit takes up 2 bytes.

Happy MEMTriggering!

---------------------------------------------------------------------------------------------------------------

QUOTE
That should clear up some confusion... what happens if I put in an offset that is outside the range of death counters? Will I get an error?


Think I'll update it so you have to put in a death counter valid offset. Right now you'll just get meaningless useless info.
Report, edit, etc...Posted by UED77 on 2005-07-28 at 15:13:44
It was supposed to be the unit of the Mercenary Biker, but it was taken out of the game, along with the Mercenary Gunship, which doesn't have a distinctive portrait.

Very nice Tutorial, DT. That should be submitted to the database, or at least stickied, because no-one will remember it was on page #17 when we are at page #45 or so...

UED77
Report, edit, etc...Posted by DT_Battlekruser on 2005-07-28 at 15:21:29
http://www.staredit.net/index.php?tutorial=240

LW, could you fix the [color] tag when you get a chance?

And I suppose DsicipleofAdun should get credit for the list.. there really should be an "Edit Your Tutorial" function.
Report, edit, etc...Posted by Lisk on 2005-07-28 at 15:25:46
So... how the list with "effect : trigger" going on? smile.gif

would be hella good
Report, edit, etc...Posted by l)ark_13 on 2005-07-28 at 15:35:52
Well, I've come up with something pretty cool.
I changed the air weapons for the marine! Yay!
The bad things that it only HALF works. See, it has the right range and cooldown rate as the weapon you change it to, just the wrong sprite. So it will be the same sprite as the marine gause riffle.
But, the ghost's air weapons also changed as an unknown side effect. No matter what you change the marine's weapon to its always going to be the marine's gause riffle for the ghost. It has the same cooldown rate and range AND sprite as the gause riflle. Its pretty cool.
So far I just tested with the units.dat weapons and so I'm not sure how to change every unit's weapons; only marines... sorta... tongue.gif
Once I do a little more reaserch I should be able to change any unit's weapon to w/e I want. (Hopefully)

I used DiscipleofAdun's offsets to find this. 50% credit goes to him
(Sorry tongue.gif )
Report, edit, etc...Posted by Rantent on 2005-07-28 at 15:49:45
Cool, you could upgrade weapon range. Changing weapons in an rpg. cool1.gif
I'd just like to say, rofl. [attachmentid=12230]
Report, edit, etc...Posted by l)ark_13 on 2005-07-28 at 15:54:12
Only for marines so far sad.gif
Report, edit, etc...Posted by DiscipleOfAdun on 2005-07-28 at 15:54:18
What data file entry did you use to change the weapon? Oh, maybe you need to change both the ground and the air weapon for the units that use the same weapon. That might solve it.

Oh, and thanks for the credit.
Report, edit, etc...Posted by l)ark_13 on 2005-07-28 at 16:01:00
I used artmoney. I could have used Tsearch but I was finding it annoying. Both are annoying, but both are good for different things I suppose. I used this offset (thanks to DiscipleofAdun)
6B8638

But you cant change the ground weapons because it uses P11 in triggers. I PMed BK about that.
Report, edit, etc...Posted by Mr_Mooo_Cow(U) on 2005-07-28 at 16:01:42
dark i did the same thing and ive already done it with other units, so no not only mariens so far.
Report, edit, etc...Posted by l)ark_13 on 2005-07-28 at 16:04:42
You should've posted it then! gj though
How you do it?
Report, edit, etc...Posted by DiscipleOfAdun on 2005-07-28 at 16:05:34
Arggg....

There must be a way around it. There must be.
Next Page (14)