Staredit Network

Staredit Network -> UMS Assistance -> Data Storage (DIFFICULT)
Report, edit, etc...Posted by Desperado on 2007-02-07 at 12:30:20
If you think this is easy, you are not understanding the problem. Please don't post if you don't know what you're talking about. I will try to explain this in as detailed a way as I can.

I have a 5x5 grid of 25 locations in a barred off area. The player has one unit inside this area, and no others ever enter it. When the player moves his unit to a new spot in the 5x5 grid, a trigger activates. He can then move back to where he was, and a new trigger will activate. If a player moves to a spot, that trigger only activates ONCE, and will not activate again until the player moves to a different spot first.

01 02 03 04 05
06 07 08 09 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

For example, if the player is at location 13 to start out, nothing happens. If he moves to a neighboring location such as 07, 08, 09, 14, 19, 18, 17, 12, then the trigger associated with whichever location he goes to will activate once, and then the system must wait until he moves to a new spot. He can move back and forth between 12 and 13 and each will activate each time he moves from one to the other.

The problem is storing the value of where the player is currently, so you know not to activate the trigger a second time. Because you can only test if a death counter IS a value and not if it is NOT a value, the only viable solution I can see is to have twenty five different death counters or switches, each one representing a spot on the grid. Twenty five boolean variables however is not an ideal storage method. Anyone have a more efficient method?


Non-viable methods:
Having a single death counter equal to the player's current location will not work. You'd essentially be testing if the location is 01 OR 02 OR 03 OR anything but the current location, and SC has no OR functionality. It would require 24 duplicate triggers for each location.

Using any units, burrowed or otherwise, is totally out of the question. Multiple players are inside this system and I do not have units to spare.

Moving locations around requires units, and is out of the question.
Report, edit, etc...Posted by Ihjel on 2007-02-07 at 12:46:57
Actually you can detect if a deathcount is not value.


Trigger
Description:
Detecting Not-Value
Conditions:
¤ Deathcount is at least 12
¤ Deathcount is at most 10
Actions:
¤ whatever

will detect that the deathcount is not 11.
Report, edit, etc...Posted by Desperado on 2007-02-07 at 12:49:27
QUOTE
Actually you can detect if a deathcount is not value.

If only it were that easy. The two conditions cancel each other out. There is no number in existence that is less than ten AND more than twelve.
Report, edit, etc...Posted by spinesheath on 2007-02-07 at 12:52:42
SC would have to treat it as Cond.1 OR Cond.2 to give the desired effect. I don't think SC will ever fire this trigger.

But the solution is fairly simple, actually. It uses 50 triggers, roughly:

For location a:

(1) If DC < a Then action

(2) If DC > a Then action

Or did I miss something? I don't think so...

Edit: Uh, of course you'll need a "bring to location a" as condition for both and a "set DC to a" as action.
Report, edit, etc...Posted by Desperado on 2007-02-07 at 13:53:21
QUOTE
But the solution is fairly simple, actually. It uses 50 triggers, roughly:

Okay this -should- work. For some reason I had thought that it didn't but now I can't seem to think of what my reasoning was.

Yea.. this is the easiest way to do it. For some reason I didn't want to add another 25 triggers when I last thought of this but that seems really stupid. Gracias.
Report, edit, etc...Posted by JaFF on 2007-02-07 at 14:00:23
I can suggest two options:

1.Hold the X and Y coordinates (where X [1..5] and Y [1..5]), and detect the change for the X and Y axis. Have four deathcounters: Xformer, Xnew, Yformer, Ynew. You will need 14 conditions to detect where the unit moved.

2.Use a mobile grid (this can be done only if there are no flying units in that area). Set the mobile grid around the unit like so:
[o][o][o]
[o][x][o]
[o][o][o]

The X is the unit. A simple bring condition and a deathcounter to hold the number of the cell you're in, so you know what action to execute. This system may have problems, as the mobile grids are not perfectly accurate. I would use the first method because this one seems... unreliable.

Edit: Just remember to create a new grid not on the unit, but on the 2x2 (or whatever) location he entered to trigger the new grid creation.
Report, edit, etc...Posted by PCFredZ on 2007-02-07 at 14:29:56
Use different players to designate a spot you "have been standing on" and a spot you "just arrived at". E.g. P9 = where you're standing on and P10 = new spot. When P10 brings a unit to your person's moving location, give all men owned by P9 to P10 and give 1 unit owned by P10 at your moving location to P9.

The "Not" function can be achieved through two triggers. The first trigger detects "Yes" and sets a death count. The second trigger detects if that death count is NOT set, which would mean "No".
Report, edit, etc...Posted by spinesheath on 2007-02-07 at 14:45:20
QUOTE(Desperado @ Feb 7 2007, 01:30 PM)
Using any units, burrowed or otherwise, is totally out of the question. Multiple players are inside this system and I do not have units to spare.[right][snapback]624193[/snapback][/right]


My way of "NOT-ing" costs 1 less DC. A switch would be enough, btw.
Report, edit, etc...Posted by Koltz on 2007-02-07 at 14:58:59
When the trigger activates when he moves to a square, center a small location (X) on the square the unit is on. Then, have a condition for each and every square, "Bring exactly 0 unit to X".
Report, edit, etc...Posted by iHaveNoRegrets on 2007-02-07 at 15:10:30
I am not really understanding the problem here. From what I read, you want the map to know where the unit is currently, it is as simple as using a single unit death and a number for each location. If you want it to identify that when it moves fom 12 to 13, then just run something like this:

Trigger
Players:
¤ Player 1
Conditions:
¤ Bring at least 1 Unit1 to 13
¤ Unit2 death(s) is exactly 12
Actions:
¤ Effect for moving from 12 to 13
¤ Set Unit2 Death(s) to 13
¤ Preserve Trigger
Report, edit, etc...Posted by spinesheath on 2007-02-07 at 16:02:35
QUOTE(iHaveNoRegrets @ Feb 7 2007, 04:10 PM)
I am not really understanding the problem here. From what I read, you want the map to know where the unit is currently, it is as simple as using a single unit death and a number for each location. If you want it to identify that when it moves fom 12 to 13, then just run something like this:




Trigger
Players:
¤ Player 1
Conditions:
¤ Bring at least 1 Unit1 to 13
¤ Unit2 death(s) is exactly 12
Actions:
¤ Effect for moving from 12 to 13
¤ Set Unit2 Death(s) to 13
¤ Preserve Trigger

[right][snapback]624226[/snapback][/right]


Nice one, you'd roughly have 25*25 = 625 triggers...
Report, edit, etc...Posted by Desperado on 2007-02-07 at 16:13:13
QUOTE
When the trigger activates when he moves to a square, center a small location (X) on the square the unit is on. Then, have a condition for each and every square, "Bring exactly 0 unit to X".

Oh boy! Spend six extra locations! GOOD SYSTEM! The 50 trigger, 1 deathcount, no extra locations method works fine.
Report, edit, etc...Posted by Laser_Dude on 2007-02-07 at 16:23:34
QUOTE(Desperado @ Feb 7 2007, 02:13 PM)
Oh boy! Spend six extra locations! GOOD SYSTEM! The 50 trigger, 1 deathcount, no extra locations method works fine.
[right][snapback]624243[/snapback][/right]


Was that sarcasm? You could use the system you quoted with 25 triggers, no deathcounts, no extra units, and 1 location. You don't need 6 locations. Also note that when using this system, you should center on the location not the unit.
Report, edit, etc...Posted by Desperado on 2007-02-07 at 16:33:40
QUOTE
Was that sarcasm? You could use the system you quoted with 25 triggers, no deathcounts, no extra units, and 1 location. You don't need 6 locations. Also note that when using this system, you should center on the location not the unit.

There aren't actually 25 locations. I'm using a crazy system of Unique Location Overlaps that I'd rather not explain, but it effectively creates 25 "virtual" locations for use with the Bring condition. So I can't center the location on those locations. And there are six players, I would need one location for each player. Additionally, I don't have a master location over the area so I would need one for that too. So it would actually require seven extra locations. I'd rather decrease from the 25 death counters I'm using now to 1 and not waste any locations unnecessarily. A few extra triggers (an unlimited resource) is a good tradeoff for saving locations and death counters which are in extremely limited supply.

This has pretty much been solved.
Report, edit, etc...Posted by Laser_Dude on 2007-02-07 at 16:37:06
Hmm, well I don't thin you'd need seven. You could recycle your location. And use the same one for all 7 players. Oh, hmm. 'Unique location overlaps'. That makes things tricky. Yeah, I guess you'd be better off with the previous system.

And what are you doing that is getting close to requiring all 255 locations?
Report, edit, etc...Posted by spinesheath on 2007-02-07 at 16:59:09
You could not recycle that extra location - it has to store the place where the unit was before. If you recycle it, it would have to store 6 places at once...

JaFF's option #1 is worth considering: It uses 10 locations in total and 4 DCs. Triggers should be a little less than my suggestion, not many though.
Report, edit, etc...Posted by Koltz on 2007-02-07 at 17:03:22
Location overlaps are like for example in a square:

1 2 3
4 5 6
7 8 9

Use 4 locations, one from 1-6(A)/4-9(B)/1-8©/2-9(D)

For 1, the trigger would be

Bring 1 to A
Bring 0 to B
Bring 1 to C
Bring 0 to D

For 2 the trigger would be

Bring 1 to A
Bring 1 to B
Bring 1 to C
Bring 0 to D

For 3 the trigger would be

Bring 0 to A
Bring 1 to B
Bring 1 to C
Bring 0 to D

etc.

good system, might i add
Report, edit, etc...Posted by spinesheath on 2007-02-07 at 17:27:47
5x5 would make out 8 locations, then? Or can you do it even better than 4 2x5 and 4 5x2 locations? I don't think it's possible.
Well, you can do JaFF's suggestion #1 with 8 locations then, but mine as well wink.gif
Report, edit, etc...Posted by Laser_Dude on 2007-02-07 at 17:32:55
Yes, it is, Unfortunatly, as with any overlap system, you cannot create units, or center locations at any given location.
Report, edit, etc...Posted by Oo.l3ahamut.oO on 2007-02-07 at 18:29:43
Well I'm surprised here... all these complex answers to seemingly simple question. Why not set it up that a burrowed ling is beneath the players unit, when he player moves to a location without the ling the ling is moved underneath and the action is fired.

This can be completed with 25 triggers unless I read this wrong but that is a way to detect where the player already was/is and when to fire the action.
Report, edit, etc...Posted by Desperado on 2007-02-07 at 18:34:49
QUOTE
Well I'm surprised here... all these complex answers to seemingly simple question. Why not set it up that a burrowed ling is beneath the players unit, when he player moves to a location without the ling the ling is moved underneath and the action is fired.

I already stated I do not have extra units to use in my main post.
QUOTE
5x5 would make out 8 locations, then? Or can you do it even better than 4 2x5 and 4 5x2 locations? I don't think it's possible.

Six 5x3 locations is what I have now. It can detect where a unit is in a 5x5 grid. I am going to use 50 triggers, 1 death count, no extra locations.
Report, edit, etc...Posted by iHaveNoRegrets on 2007-02-07 at 18:49:29
QUOTE(spinesheath @ Feb 7 2007, 04:02 PM)
Nice one, you'd roughly have 25*25 = 625 triggers...
[right][snapback]624235[/snapback][/right]


Well, it works doesnt it?
Report, edit, etc...Posted by Oo.l3ahamut.oO on 2007-02-07 at 19:01:12
QUOTE(Desperado @ Feb 7 2007, 06:34 PM)
I already stated I do not have extra units to use in my main post.

Six 5x3 locations is what I have now. It can detect where a unit is in a 5x5 grid. I am going to use 50 triggers, 1 death count, no extra locations.
[right][snapback]624336[/snapback][/right]


I did miss that part of the post, but it is wierd that you cant spare up to 8 units assuming all 8 players are human. Anyways 50 trigs inst bad I guess.
Report, edit, etc...Posted by PCFredZ on 2007-02-07 at 19:30:06
That's what I suggested too but Desperado seems kinda sure that he can't afford to do that.

QUOTE(Desperado @ Feb 7 2007, 11:30 AM)
Using any units, burrowed or otherwise, is totally out of the question. Multiple players are inside this system and I do not have units to spare.
[right][snapback]624193[/snapback][/right]
Report, edit, etc...Posted by JaFF on 2007-02-08 at 01:36:49
QUOTE(spinesheath @ Feb 8 2007, 12:59 AM)
JaFF's option #1 is worth considering: It uses 10 locations in total and 4 DCs.

Where will you need 10 locations? I didn't say that. You will only need 2 locations per palyer. The X and Y coordinates.
Next Page (1)