Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Difficulties with novel SCMD Memory thing
Difficulties with novel SCMD Memory thing
May 2 2009, 4:10 pm
By: Wormer  

May 2 2009, 4:10 pm Wormer Post #1



I have a question considering the new Memory condition in the new release of SCMD.

Particularly, let's say I want to detect the Insert key pressed. I taken the Morph(U)'s map (thanks Morph(U)!!!) with EUD keypress detection. There is a trigger:
Quote from SCMD trigger
Trigger("All players"){
Conditions:
Deaths("Player 9", UnitID:1060, Exactly, 256);

Actions:
Display Text Message(Always Display, "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\x013\x004Insert");
Preserve Trigger();
}

We have the SCMD memory thing Memory(Offset, QuanityModifier, Value) (thanks SI!!!), where the Offset is an offset starting from the Deaths table (0x58A364 = 5808996 in version 1.16.1, right? At least this what EUDTrig says).

To calculate I taken EUDTrig (thanks Farty!!!) and typed in Player 9 and Unit 1060 and converted into Offset. I got 0x596A48 = 5859912.

Is this offset from Deaths table or just a memory?
I guessed this is just a memory and subtracted deaths table offset from this value, I got 5859912 - 5808996 = 50916. I put this value as the first argument to Memory condition and.... It didn't work.

I've also tried to put 50916 +/- 1 and 50916 +/- 4 values. Haven't helped.

I've tried to put the raw 5859912 value from EUDTrig. This crashes SC at start.

Can anyone help me to detect the insert key with the Memory condition?

Post has been edited 1 time(s), last time on May 2 2009, 4:16 pm by Wormer.



Some.

May 2 2009, 11:13 pm Pigy_G Post #2



Why can you just use a regular eud..?



None.

May 3 2009, 1:45 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

Memory(12728, Exactly, 256);



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

May 3 2009, 7:21 am Wormer Post #4



Quote from name:Zachary Taylor
Memory(12728, Exactly, 256);
Brief answer. Lol, my bad! :lol: How only I haven't hit an idea of clicking twice: up and down in EUDTrig.

THANK YOU :)

EDIT: Actually I forgot to divide by 4. 50916/4 - 1 = 12728.

EDIT2:
While this works for Morph's map, it crashes my map. I have no idea why this happens...
The map: http://www.mediafire.com/?r42eotztyjq
The first trigger for Player 8 in the map is the only place where it contains the Memory condition which should detect Ins key press. The map crashes on it's check instead. If you disable the condition everything would be fine. What strange is that instead of Memory the Deaths("Player 9", Exactly, 256, UnitID:1060) works fine!
Any ideas? :wtfage:

EDIT3:
Well, this is most likely SCMD problem :(
Quote from Wormer
I think I found the source of the problem. It crashes when the Memory condition is compiled from SCMD text triggers. And then even if you delete/create new Memory condition in ClassicTrigedit from the trigger which included Memory condition and was compiled from SCMD text triggers, SC still crashes.

EDIT2:
How to reproduce bug:
For example, take this map: http://www.mediafire.com/?2muofowgmt5
Run it and press insert, you'll see a text message.
After that open SCMD text triggers, press compile and exit.
Run the map in SC to see it crashes.


Post has been edited 8 time(s), last time on May 3 2009, 9:20 am by Wormer.



Some.

May 3 2009, 10:03 am rockz Post #5

ᴄʜᴇᴇsᴇ ɪᴛ!

I felt it would help in the long run if you figured it out on your own from the short answer :)

Suffice it to say, I think the memory condition was poorly implemented, and I got it to work with classic trigedit, but not with the map you gave. It's a simple matter of hex editing the map to see exactly what happens. I don't feel like doing it right now.

As a sidenote, cool ideas on the map, but I'll have you know that switches are shared, so you can't use "set switch" when detecting key presses. The only thing you can do is leaderboard, transmission, center view, display text, and probably a few other things. Since you can detect screen position, you can use f4 to center on the start location, show some help text/whatever, then stop showing it once they've moved.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

May 3 2009, 10:54 am Wormer Post #6



I generate SCMD triggers automatically and need some way to insert EUD conditions. Right now I have got that one trigger which I modify manually each time I compile my triggers. This is most definetly something wrong with SCMD text triggers, I hope SI will fix that soon.

Are switches shared? You know, I've implemented this system through DeathCounters first. We tested it with a friend of mine and I found out that DCs are shared. Then I reimplemented it using solely switches and we tested again. We played the map for a while and haven't dropped. So... It's strange.



Some.

May 3 2009, 11:19 am NudeRaider Post #7

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

How would maps work if they weren't shared?!

Simple example:
A player reaches a location and sets a switch, based on that switch everyone gets a message.

Disregard. Same trap I already fell some time ago.

Every player runs everyone's triggers locally, so they don't need to be shared.
Problems occur when EUD conditions are true for one player but false when another player checks it. And that's where shared values matter. Sorry for the confusion

Post has been edited 1 time(s), last time on May 3 2009, 3:55 pm by NudeRaider.




May 3 2009, 1:05 pm Wormer Post #8



They are not. I've just played a two-hour game on this map and everything was fine. I can show the rep.

I understand it like this. Each player runs it's own copy of application. Running equal algorithms on equal data gets equal results. Only the most important data is checked for consistency (units array, resources). The player reaches a location. As far as units data is shared it reaches the location on each player's machine. And the switch is being set on each players machine (but each player's machine set it independently from other machines!). The property that all units are synched each frame makes each machine run the set action at one time. But SC will allow someone to set a switch only on it's own machine, and it won't desynch (because switches does not synch) as long as it does not lead to difference in the main data (units, resources). I use these switches solely to display text, so it doesn't lead to problems.

By the way I found out that Deaths are synched not every frame. Actually they synch very seldom (probably after each kill or unit creation or smth), because we were able to play the map for a while before drop.

Post has been edited 1 time(s), last time on May 3 2009, 1:16 pm by Wormer.



Some.

May 3 2009, 1:08 pm ForTheSwarm Post #9



But did you run an action with that switch as a condition?

Example:

Code
Switch EUD is Set.

Display for current player, "DESYNC"




None.

May 3 2009, 1:09 pm Wormer Post #10



Quote from ForTheSwarm
But did you run an action with that switch as a condition?

Example:

Code
Switch EUD is Set.

Display for current player, "DESYNC"
Yes, but these actions are only display text, play WAV, preserve and other switches which I use only in the same manner.

EDIT:
I also have doubts if players who does not present in the game are synched. Probably at least deaths data is not synched for such players. Also, probably you can defeat a computer player (or dont set up a location for him), then create unit for it and move it via EUD. If not existent players data is not synched... you guess what.

Post has been edited 3 time(s), last time on May 3 2009, 1:21 pm by Wormer.



Some.

May 4 2009, 12:07 am rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

I guess I was wrong then. Perhaps we need a list of shared data.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:41 am]
v9bettel -- Nice
[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
Please log in to shout.


Members Online: Revenant