|
|
|
|
| JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum. |
 |
|
02-12-2012, 04:13 AM
|
#46 (permalink)
|
|
User
Join Date: May 2009
Posts: 495
|
does this snippet check if the path or line between two points are blocked?
or just a radius around the unit is being checked?
|
|
|
02-12-2012, 04:38 AM
|
#47 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Quote:
does this snippet check if the path or line between two points are blocked?
or just a radius around the unit is being checked?
|
Path. It tries to get from one side of the tower to the other ^)^. If it can't make it to the other side, the path is blocked ;p.
2 sides chosen are based on a set of if statements to check what path through the tower was possibly blocked (left -> right, bottom -> top, right -> top, etc).
|
|
|
02-13-2012, 08:04 AM
|
#48 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Fixed a bug with towers that are built 1 space apart from each other and a third tower built to possibly block the space in between. It would always read it as a block : ). Now it works properly.
Thanks to magtheridon96 for his wmw noobiness as that allowed him to find the bug ; ).
|
|
|
02-13-2012, 08:30 AM
|
#49 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,754
|
Quote:
|
Thanks to magtheridon96 for his wmw noobiness as that allowed him to find the bug ; ).
|
I'm improving D:
And my score is pretty good compared to what you've seen other "pros" do D:
|
|
|
02-13-2012, 06:33 PM
|
#50 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Fixed bug with retrieving radius (was adding 16) and removed a debug message. Would have been updated last night, but my connection was down.
|
|
|
02-14-2012, 09:34 PM
|
#51 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
This still has a bit of the bug mag found in it :\. I'm seeing noobs playing my wmw map encounter it over and over again. I'll investigate it tomorrow as I don't have time today.
|
|
|
02-16-2012, 02:38 AM
|
#52 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Fixed final band-aid bug
Fixed 32x32 towers
Made all collision sizes work (no longer hard coded)
Fixed larger towers by making start and end points calculated while determining what is blocked around the tower
So... I believe that this now has 0 bugs and it's uber fast. I could run it off of a minimum binary heap to minimize the loop sizes when the path isn't blocked, but that'd significantly increase overhead when the path is blocked (bad worst case scenario). I'm trying to keep the worst case scenario as good as possible as I think a freeze is much worse than a generally slower operation ;D.
Anyways Bribe, you can go ahead and approve this for use in Tower War and Tower Defense maps now : D.
|
|
|
02-16-2012, 03:06 AM
|
#53 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,754
|
Note: A resource can only be approved if it's requirements are approved ;)
|
|
|
02-16-2012, 05:36 AM
|
#54 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
Approved. Fun resource.
Edit: The RegisterPlayerUnitEvent in your map that "AnitBlock" uses is the suck, what's the point in adding verbosity by requiring boolexpr instead of code? That's a sucky change.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-16-2012, 07:07 AM
|
#55 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Uh, I follow JASS standards. If you look at the actual resource, it does not have the Condition stuff in there ; ).
|
|
|
02-16-2012, 07:50 AM
|
#56 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
If you really followed JASS standards your programming structure would be way more readable.
Earlier this morning your code looked different, you just changed it ;)
You originally wrote
Jass:
call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_CONSTRUCT_START, @Condition(@function thistype.checkBlock@)@)
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-16-2012, 08:18 AM
|
#57 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Uh huh, because I had forgotten to change it back. It's Condition( ) in my maps ; ).
|
|
|
02-16-2012, 08:43 AM
|
#58 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
And in my WarChasers 2 map it only registers for players 0, 1, 5 and 6 (provided they are also playing).
To each his/her own ;)
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-16-2012, 02:58 PM
|
#59 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,754
|
And in my map, I use a dynamic version of RegisterPlayerUnitEvent that allows me to use multiple triggers so I can enable and disable certain boolexprs :P
|
|
|
02-21-2012, 01:10 AM
|
#60 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
Fixed final bugs... I think IsPathable was bugging it up, so get the updated IsPathable objects.
This also uses better stuff now for generating the pathing map, so it's a little bit faster on load time ^)^.
Also, it is 100% official.. if players are allowed to build on all corners in a playable map area, they will be able to blanket the entire area. As long as you make it so one corner is unbuildable, you will be ok ^)^.
This is due to how the preprocessing stuff works. Sadly, there is no way to resolve this issue, it's 100% impossible. Resolving this issue would make it impossible to build bricks of towers, which don't technically block >.>. The preprocessing was done purposefully to allow for bricks (in wmw, air guards are always bricks of towers). So just make one corner in each playable area unbuildable and you'll be golden.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 03:45 AM.
|