Staredit Network

Staredit Network -> Concepts -> Dieing unit detector
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-16 at 22:42:26
About a year or so ago, I accidently stumbled apon a corpse-finder in an old map of mine. I had a hero respawn system that when the hero died, it was created back in the town, a location was centered on it, and a effect was created over it (so the explosion would center on the hero, even if the hero created offset), but sometimes centered on my dieing hero out on the battlefield...

This led me to believe that sometimes a unit could be centered on while it was dieing (seemed to happen roughly 1/2 the times, and the dieing hero was always left to the hero being created in the town when I tested it). The dieing unit was affected by some triggers (such as the giving trigger, centering location trigger, some other actions, and some conditions), but not by others (such as moving the unit, or removing it). So this eventually (a year+ later tongue.gif) led me to make a test map (after the idea from Bonelesskid aka. TriggerMasta), and it worked roughly half the time. When you killed a unit, it individually checks each unit in your area (by moving them seperately to a distant area, and if the unit could not move, it was a dieing unit. Then by simply centering a location on that unit, you can create an item where the unit died.) Take note, that as I said before, it only works sometimes. I think this is because the animation/gameplay runs more times than the trigger loop, and when they run at the same time, the dieing unit can be detected, so don't think up some crazy vhp system.

You can add other randomizing triggers to it to make it look more professional and make a pretty cool enemy-dropping-item system. I'll try to follow this post up with a concept map, because my old one is extremely crude (but it does work).

(sorry if theres bad grammer of if this was hazy, I didn't have much time to post it, and I will fix it up later)
Report, edit, etc...Posted by Rantent on 2007-01-16 at 22:51:27
Fun idea, I liked the test map.
Report, edit, etc...Posted by Kookster on 2007-01-17 at 04:02:26
Thats interesting, Good find!! Im gonna think if I could impliment this in anyway.
Report, edit, etc...Posted by Mp)Blu on 2007-01-17 at 12:12:26
Whoah.. this does sound good. Hmm I could use this wink.gif
Report, edit, etc...Posted by chuiu on 2007-01-17 at 12:56:58
How about the test map?
Report, edit, etc...Posted by Oo.Insane.oO on 2007-01-17 at 15:08:56
I agree I wanna c this in action smile.gif it sounds like a really cool idea to spice up some of those rpgs out there
Report, edit, etc...Posted by PCFredZ on 2007-01-17 at 15:46:45
The moment a unit dies when you can see its hp lower to zero for a brief instant. That's probably why it satisfies some triggers like Move Location, because the 0 health unit is still the unit. However if that brief "0 health" period is at the wrong part of the trigger cycle (e.g. out of the 1/12 sec. loop), the unit would have been removed before the trigger executes.

It is possible that when you were testing Move Unit/Remove Unit, you weren't experiencing the 1/12 sec pause. However, if that was not the case -- if Move Unit and Remove Unit indeed do distinguish between regular units and 0 hp units -- then this method can definitely make a good randomized item drop system.
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-17 at 16:59:31
QUOTE(PCFredZ @ Jan 17 2007, 03:46 PM)
The moment a unit dies when you can see its hp lower to zero for a brief instant. That's probably why it satisfies some triggers like Move Location, because the 0 health unit is still the unit. However if that brief "0 health" period is at the wrong part of the trigger cycle (e.g. out of the 1/12 sec. loop), the unit would have been removed before the trigger executes.

It is possible that when you were testing Move Unit/Remove Unit, you weren't experiencing the 1/12 sec pause. However, if that was not the case -- if Move Unit and Remove Unit indeed do distinguish between regular units and 0 hp units -- then this method can definitely make a good randomized item drop system.
[right][snapback]614769[/snapback][/right]


The centering location only worked when the 1/12 second loop and the animation loop collided (based on assumptions and observations). The times it didn't work, I'm assuming the unit died in the animation loop, and could not be detected in the next trigger loop. The dying unit could never move (which, in fact, is the method I detected it).

And as for the test map, I have an extremely crude one that works, but I was planning on making a much better one today or tommorow. If you really want me to, though, I will post the crude test map.
Report, edit, etc...Posted by Kookster on 2007-01-17 at 17:04:08
post something Im curious how exactly you are doing this.
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-17 at 17:12:39
QUOTE(Kookster @ Jan 17 2007, 05:04 PM)
post something Im curious how exactly you are doing this.
[right][snapback]614802[/snapback][/right]


In its simplest form...
You kill a unit
It detects which unit dies
It makes an item

Only problem is, it doesn't always work, so you couldn't do a vhp system with it, but you can make a cool randomized item-drop-system. As for the test map, you're going to have to wait, because I'm not on my other computer and I have homework to do.

I'm assuming you do want the crappy map?
Report, edit, etc...Posted by Kookster on 2007-01-17 at 18:14:38
QUOTE
I'm assuming you do want the crappy map?
Sure
Report, edit, etc...Posted by scwizard on 2007-01-17 at 20:16:08
Very good topic thumbup.gif

Better than any of the topics visible on the concepts forum at the moment (including my own).
Report, edit, etc...Posted by Kookster on 2007-01-17 at 21:31:37
QUOTE
Very good topic thumbup.gif

Better than any of the topics visible on the concepts forum at the moment (including my own).
That was a bit random, and offtopic like.

Ok you say you move the units away then back to detect if they are dying, doesnt that kinda screw with movement and things like that!?!?
Report, edit, etc...Posted by NerdyTerdy on 2007-01-17 at 22:27:36
Wow, that looks fairly interesting. It's funny how people come across these things. The item-drop system sounds like it could be fairly interesting.
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-17 at 22:50:19
QUOTE(Kookster @ Jan 17 2007, 06:14 PM)
Sure
[right][snapback]614830[/snapback][/right]


[attachmentid=22536]
Here it is...
Lots of bugs and looks unprofessional, but gets the point across.
Comical in an odd sort of way...
Report, edit, etc...Posted by Falkoner on 2007-01-17 at 23:12:31
Pretty cool, could be used if we could find a way to make it less random, I also enjoyed slaughtering marines, until the bugs in the system managed to finally get me trapped and the marines started spawning to far away to reach sad.gif Other than that it was cool, and definitely a new concept.
Report, edit, etc...Posted by chuiu on 2007-01-18 at 15:12:50
The problem you're encountering when you say its 'random' is because the location is moving to marines that are still alive while you are killing other ones. You can do the exact same thing with these 2 simplified triggers.

CODE
Trigger("Player 1"){
Conditions:
Score("Current Player", Kills, At least, 1);
Bring("Foes", "Terran Marine", "Checking_Location", Exactly, 0);

Actions:
Create Unit("Player 8", "Data Disc", 1, "Checking_Location");
Set Score("Current Player", Set To, 0, Kills);
Preserve Trigger();
Comment("create");
}

Trigger("Player 1"){
Conditions:
Always();

Actions:
Move Location("Current Player", "Jim Raynor (Marine)", "Anywhere", "Attack_Area");
Move Location("Foes", "Terran Marine", "Attack_Area", "Checking_Location");
Preserve Trigger();
Comment("Location");
}


If you always attack the leftmost bottommost unit first you will always create a data disc.
Report, edit, etc...Posted by Kookster on 2007-01-18 at 18:46:08
I had a problem like this when i was doing a targeting system, since starcraft always detects things in a specific order. If you want to see that order just check out this map I made a while ago http://www.staredit.net/index.php?download=5127
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-18 at 18:49:23
QUOTE(Falkoner @ Jan 17 2007, 11:12 PM)
Pretty cool, could be used if we could find a way to make it less random, I also enjoyed slaughtering marines, until the bugs in the system managed to finally get me trapped and the marines started spawning to far away to reach sad.gif Other than that it was cool, and definitely a new concept.
[right][snapback]614969[/snapback][/right]


Bugs we're the reason I didn't want to post that test map. I was going to make a more professional version (may still).

QUOTE(chuiu @ Jan 18 2007, 03:12 PM)
The problem you're encountering when  you say its 'random' is because the location is moving to marines that are still alive while you are killing other ones.  You can do the exact same thing with these 2 simplified triggers.

CODE
Trigger("Player 1"){
Conditions:
Score("Current Player", Kills, At least, 1);
Bring("Foes", "Terran Marine", "Checking_Location", Exactly, 0);

Actions:
Create Unit("Player 8", "Data Disc", 1, "Checking_Location");
Set Score("Current Player", Set To, 0, Kills);
Preserve Trigger();
Comment("create");
}

Trigger("Player 1"){
Conditions:
Always();

Actions:
Move Location("Current Player", "Jim Raynor (Marine)", "Anywhere", "Attack_Area");
Move Location("Foes", "Terran Marine", "Attack_Area", "Checking_Location");
Preserve Trigger();
Comment("Location");
}


If you always attack the leftmost bottommost unit first you will always create a data disc.
[right][snapback]615116[/snapback][/right]


Wrong.

1) it doesnt always make the disc if you kill the bottom left one
2) it creates it on other marines even when theres another one alive there
3) I have a checking system in place so the marines to the left of the corpse get 'ignored.'

As for conserving the trigger...
This was a mere 5 minute test map that I paid no attention to conserving triggers or making it professional, and as I said before, I never wanted to release that.

It also seems that if you stop, then manually order your unit to attack the enemy, it has more of a chance to make a disc. This also seems to agree with my theory of an animation/trigger loop (still not sure if thats how starcraft works though, and an answer would be appreciated).

If this thread wasn't specific enough or just plain vauge or ununderstandable, tell me; I will have more time over the weekend to fix it up if you want me to...
Report, edit, etc...Posted by chuiu on 2007-01-19 at 01:43:40
QUOTE(Lethal_Illusion @ Jan 18 2007, 05:49 PM)
1) it doesnt always make the disc if you kill the bottom left one
2) it creates it on other marines even when theres another one alive there
3) I have a checking system in place so the marines to the left of the corpse get 'ignored.'
[right][snapback]615174[/snapback][/right]


1. Of course not, you have it remove discs that are improperly placed due to your bad location checks.
2. Same problem in 1, you could use some extra locations.
3. Of course you do, and this is what causes some of the problems. You also don't need to do the moves, you only need to give to another player. You also realize that putting this in a map would be incredible impractical and restricting to gameplay.

All you have to do is make a few extra triggers to check for multiple marines and my system would work better and be much cleaner.
Report, edit, etc...Posted by SomeIdiotNerd on 2007-01-19 at 18:49:44
This all seems very intresting to me, and i could use it very well in my map i'm making, i don't care how many trigs or location there are, i just want one without bugs.

So i hope you find out how to do it without bugs =)
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-19 at 19:33:31
QUOTE(chuiu @ Jan 19 2007, 01:43 AM)
1. Of course not, you have it remove discs that are improperly placed due to your bad location checks.
2. Same problem in 1, you could use some extra locations.
3. Of course you do, and this is what causes some of the problems.  You also don't need to do the moves, you only need to give to another player.  You also realize that putting this in a map would be incredible impractical and restricting to gameplay.

All you have to do is make a few extra triggers to check for multiple marines and my system would work better and be much cleaner.
[right][snapback]615307[/snapback][/right]


I don't think you understand the map...
If you think you can do better, be my guest.
As I have said 4+ times by now, this was a trash test map, I spent no time on it, the only purpose it served was to test my theory, and I never expected to release it...
As I have said before, if you don't like it, make a better one.

QUOTE(SomeIdiotNerd @ Jan 19 2007, 06:49 PM)
This all seems very intresting to me, and i could use it very well in my map i'm making, i don't care how many trigs or location there are, i just want one without bugs.

So i hope you find out how to do it without bugs =)
[right][snapback]615547[/snapback][/right]


Bugs we're expected, it is a trashy test map after all.
The only reason I showed you guys it was because I didn't have time to make a better one. I'm still planning on making a better one...
Report, edit, etc...Posted by Shocko on 2007-01-19 at 20:35:11
Your crude test map... isn't that the one where I got trapped by all those data discs ?
Report, edit, etc...Posted by Lethal_Illusion on 2007-01-19 at 21:06:08
QUOTE(Shocko @ Jan 19 2007, 08:35 PM)
Your crude test map... isn't that the one where I got trapped by all those data discs ?
[right][snapback]615596[/snapback][/right]


Yes.
Report, edit, etc...Posted by Kookster on 2007-01-20 at 03:43:59
Hmm ive been working on making a good version, but its a bit hard. I had one way that would detect every kill, downside was there was another glitch with the giving units and the units delay while being given was to big.

Im curious to how you will make this work well.

PS: This is the first thing in mapping that has gotten me interesting in mapping again in a while seriously good find!!
Next Page (1)