Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Revert P10 unit back to it's original color
Revert P10 unit back to it's original color
Mar 14 2022, 7:44 pm
By: Prankenstein  

Mar 14 2022, 7:44 pm Prankenstein Post #1



In my defense map, there's a group of invincible cannons as the final line of defense. If the remaining enemy wave can survive the walk through these cannons, the game ends.

One problem is once the enemies plow through the first 5 players, the game is completely in the hands of the 6th player to stop the enemy.

I want other players to be able to still get involved at this point and save the game.

I had an idea of trapping an Infested Kerrigan on a 1x1 tile near the end, by the cannons, and allowing one player to "Rent" the Kerrigan using Gas for the remainder of the round. This Kerrigan would have infinite mana for Ensnares and Storms.


To my main question: I preplace the Kerrigan with P10 as the owner. When someone purchases Kerrigan, I give the unit from P10 to Current Player. Then when the round ends I give the Kerrigan from Force 1 back to P10. But at this point, Kerrigan retains the color of the previous player who owned it (although the correct color is displayed on the minimap). I understand this is a well known quirk, but it's actually really bad. If someone sees the Kerrigan with a teammate's color, they won't try to purchase it and every second counts at the end.


Methods tried to far:
- ACTION: Give 1 Kerrigan from P10 to P10 (hoping the color would be transferred)
- There's 15 rounds so 15 possible chances of renting Kerrigan. Preplaced 15 Kerrigan owned by P10 in corner of map with the property of cloaked. Give the Kerrigans infinite mana. When round ends I remove the original Kerrigan, and move a new (cloaked) one as a replacement. Then set the Kerrigan's mana to 0 to remove the cloak. Problem being the Kerrigans start the game UNCLOAKED and I hate how messsy it looks on an otherwise very tidy map.


Any other methods I could try?



None.

Mar 14 2022, 8:01 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

make them rescuable




Mar 14 2022, 8:46 pm Prankenstein Post #3



Quote from NudeRaider
make them rescuable

Oh man, sending me down a rabbit hole :D



None.

Mar 14 2022, 10:18 pm Prankenstein Post #4



Quote from NudeRaider
make them rescuable

After some digging it looks as though I won't be able to use this method, as I'm already using up all 8 player slots. 7 and 8 are both computers. 7 is normal units and 8 is heroes.



None.

Mar 14 2022, 10:19 pm DarkenedFantasies Post #5

Roy's Secret Service

With an EUD action, after giving it back to P10, you can set the unit's CSprite Player ID to 9, which will change the player color to Player 10's.

I can't tell you what the address would be since it's on a first-come-first-served basis and I think would depend on a unit's index if preplaced. I think a unit preplaced as index 0 always has a sprite pointer to 0x0063FD04, so you can try moving your infested kerrigan to be index 0 in the units properties, and for your trigger giving it back to P10, add an action to modify memory at 185962; set to 589972 (this value is specific for an infested kerrigan with P10 color).




Mar 14 2022, 10:35 pm Prankenstein Post #6



With an EUD action, after giving it back to P10, you can set the unit's CSprite Player ID to 9, which will change the player color to Player 10's.

I can't tell you what the address would be since it's on a first-come-first-served basis and I think would depend on a unit's index if preplaced. I think a unit preplaced as index 0 always has a sprite pointer to 0x0063FD04, so you can try moving your infested kerrigan to be index 0 in the units properties, and for your trigger giving it back to P10, add an action to modify memory at 185962; set to 589972 (this value is specific for an infested kerrigan with P10 color).

Thanks, I'll give my best attempt and report back here.



None.

Mar 15 2022, 12:03 am Prankenstein Post #7



Quote from Prankenstein
With an EUD action, after giving it back to P10, you can set the unit's CSprite Player ID to 9, which will change the player color to Player 10's.

I can't tell you what the address would be since it's on a first-come-first-served basis and I think would depend on a unit's index if preplaced. I think a unit preplaced as index 0 always has a sprite pointer to 0x0063FD04, so you can try moving your infested kerrigan to be index 0 in the units properties, and for your trigger giving it back to P10, add an action to modify memory at 185962; set to 589972 (this value is specific for an infested kerrigan with P10 color).

Thanks, I'll give my best attempt and report back here.

First I moved the P10 Infested Kerrigan to Index 0.

Using the Classic Trigger Editor, when I enter "185962" into there, it automatically changes the address to "0x0063FD0C".

Then when I enter "0x0063FD04" into the address, it changes back to "185960".


Using the text based Trigger Editor, I set the action to:

Code
MemoryAddr(0x0063FD04, Set To, 589972);


Alas, I haven't been able to achieve the color change.



None.

Mar 15 2022, 12:46 am Prankenstein Post #8



I came up with a pretty good solution which I'm satisfied with for now. I preplaced an arbiter owned by P10 at the far bottom left corner of the map, hidden by the UI. Under the arbiter, I preplaced 15 P10 Kerrigans onto "placeable" null terrain. The only real downside is the arbiter can be seen on the mini map.



None.

Mar 15 2022, 12:58 am Prankenstein Post #9



Quote from Prankenstein
I came up with a pretty good solution which I'm satisfied with for now. I preplaced an arbiter owned by P10 at the far bottom left corner of the map, hidden by the UI. Under the arbiter, I preplaced 15 P10 Kerrigans onto "placeable" null terrain. The only real downside is the arbiter can be seen on the mini map.

If there's an easy way to change P10's color to black, that would really seal the deal.



None.

Mar 15 2022, 1:19 am DarkenedFantasies Post #10

Roy's Secret Service

Quote from Prankenstein
Using the Classic Trigger Editor, when I enter "185962" into there, it automatically changes the address to "0x0063FD0C".

Then when I enter "0x0063FD04" into the address, it changes back to "185960".


Using the text based Trigger Editor, I set the action to:

Code
MemoryAddr(0x0063FD04, Set To, 589972);


Alas, I haven't been able to achieve the color change.
0x0063FD0C (185962) is the correct address. 0x[...]04 (185960) is the address of the CSprite entry, but the value you want to change is offset by 8 bytes (10 actually, but we can only read/write 4 bytes at a time), so set the value for 0x[...]0C (185962).




Mar 15 2022, 1:41 am Prankenstein Post #11



0x0063FD0C (185962) is the correct address. 0x[...]04 (185960) is the address of the CSprite entry, but the value you want to change is offset by 8 bytes (10 actually, but we can only read/write 4 bytes at a time), so set the value for 0x[...]0C (185962).

Ok so I set the action to:

MemoryAddr(0x0063fd0c, Set To, 589972);

This action takes place after P10 receives the Kerrigan. Still the same result, no color change.



None.

Mar 15 2022, 2:30 am DarkenedFantasies Post #12

Roy's Secret Service

I tried it for myself on a test map and it works as expected. It must be that your infested kerrigan's CSprite entry is on a different address; I don't really see any other reason why it wouldn't work. I guess if you can send me your map, I could give you the address you need to modify, or otherwise find out why it's not working.




Mar 15 2022, 2:58 am Prankenstein Post #13



I tried it for myself on a test map and it works as expected. It must be that your infested kerrigan's CSprite entry is on a different address; I don't really see any other reason why it wouldn't work. I guess if you can send me your map, I could give you the address you need to modify, or otherwise find out why it's not working.

I PMed you the map if you'd like to take a look.



None.

Mar 15 2022, 3:35 am DarkenedFantasies Post #14

Roy's Secret Service

Yeah, the entry was at a different address than I expected it to be: 185710 (0x0063F91C).

It just occurred to me that, alternatively, you could also simply give the unit to Player 7 or 8 and then Player 10, for example. Though it would then be white or green.

Quote from Prankenstein
If there's an easy way to change P10's color to black, that would really seal the deal.
There used to be, but a while back the old team color arrays got deprecated or something by an SCR patch and I'm currently not aware of another way to directly edit the color values. Later tonight, I'll verify if it wasn't just a bug that got fixed later on.

However it might not be necessary as you probably could just make the above EUD set the sprite's color to a value above 15 (Player 16) or something instead of 9 (Player 10), whichever player number yields the color black in SCR. If you'd like to give it a try yourself, simply add 65536 to the value set in the trigger action to increment the Player ID by 1 (which would then yield Player 11's color).




Mar 15 2022, 5:05 am Prankenstein Post #15



Yeah, the entry was at a different address than I expected it to be: 185710 (0x0063F91C).

You're a boss! Works as expected now.

It just occurred to me that, alternatively, you could also simply give the unit to Player 7 or 8 and then Player 10, for example. Though it would then be white or green.

I thought about this but ultimately decided against it because I want Kerrigan to stand out as something important.

There used to be, but a while back the old team color arrays got deprecated or something by an SCR patch and I'm currently not aware of another way to directly edit the color values. Later tonight, I'll verify if it wasn't just a bug that got fixed later on.

However it might not be necessary as you probably could just make the above EUD set the sprite's color to a value above 15 (Player 16) or something instead of 9 (Player 10), whichever player number yields the color black in SCR. If you'd like to give it a try yourself, simply add 65536 to the value set in the trigger action to increment the Player ID by 1 (which would then yield Player 11's color).

I'm happy as it is, your solution works exactly how I want it to. Thanks!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: IlyaSnopchenko, NudeRaider