| 04-18-2009, 06:34 PM | #1 |
I was thinking of creating a maze, but at the same time I was sick of the maze only being able to be played once. So i thought about having different levels for each level. Meaning level 1 can turn out 5 different ways or something. The only problem is if I just check if the unit is on a certain type of terrain, it evalutes to true too soon. Like if a unit is on a grass tile, and it is surrounded by dirt, it will be killed before it touches the dirt. So the solution to that would to just create rects/regions, at the places I wanted the unit to die. But since I have 5 different outcomes for each level would it be really slow if I checked for each piece of terrain that was of tileset grass and then checked for what around it was dirt. Then if that direction checked out ok I created a rect/region at the grass location with an offset. Then added an event to a kill trigger if unit enters that region/rect. |
| 04-18-2009, 07:48 PM | #2 |
Are you using this tool? |
| 04-19-2009, 05:01 AM | #3 |
No I'm not. Sorry if it is unclear. Litterly I think it, but can't type it :). What I'm doing is checking for areas that are grass then finding the areas around it that are dirt. Then creating a region/rect at point of offset from the grass depending in which direction the dirt tileset is. Then once created I add an event to the killing trigger. Unit enters the region I just made. |
| 04-19-2009, 05:39 AM | #4 |
Dude... You're making it more complicated than it needs to be, simply set all units to a unit array, than loop through them getting their location, when you have the location simply check if the terrain type of the location == death terrain(dirt). |
| 04-19-2009, 11:55 AM | #5 |
Yes, I am still a little unclear as to what the question is but if what Feroc1ty poses is the solution (in which case this post is irrelevant) then I do in fact know what you are trying to say. In other words, if Feroc1ty is not accurate, then please try to re-explain what exactly you want to happen. |
| 04-19-2009, 04:20 PM | #6 |
I was saying that, the way he said will not work. Reason being it kills them before they step on the dirt. Or at least I want to give the units more space. So I'm creating regions at the startup of the game checking the path and setting them with an offset of the grass tile so there is more space. I'm just not sure if that check will take a huge amount of time. |
| 04-19-2009, 05:43 PM | #7 |
Regions are sets of 32x32 points, no? That might not be fine grained enough for your purposes. But performance for one region check should be fine. |
| 04-19-2009, 08:42 PM | #8 | |
Quote:
What you're doing is totally unnecessary, terrain check works perfectly... ![]() |
| 04-19-2009, 08:52 PM | #9 | |
Quote:
Yes, but thats not accurate, regions would be the most accurate way. |
| 04-19-2009, 09:15 PM | #10 |
Well sure the terrain check could work for many things, but that's not exactly how I want it to work. It tends to kill the units before they hit the dirt. I want to give a little bit more space which is why I'm finding the grass spots and creating regions from an offset to kill the units when they enter it. Sorry not trying to make trouble out of this. |
| 04-19-2009, 09:29 PM | #11 | |
Quote:
What terrain are you using, it really depends on the type of terrain you tend to use, if you use something that's accurate and straight such as marble, it works 100%. |
| 04-19-2009, 09:43 PM | #12 |
My maze isn't one constant tile so that is another one of the reasons. So there are no constant tiles. |
