EqualiseR's Customizable Region/Terrain-Kill System v3.0

Do you need World Editor help? Ask here!
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)

EqualiseR's Customizable Region/Terrain-Kill System v3.0

New postby EqualiseR on Sun Mar 18, 2012 4:02 pm

Due to the fact that I often see people attempting to find or create an adjustable/customizable Terrain-Kill trigger, I have decided to post mine on here. Before the Terrain-Kill system will work properly, you must set all of the variables via the "TerrainKill Configuration" trigger.

If you use this system, please credit me.


Here is the main trigger: ----- (Note: I have attached the map file which contains the TerrainKill Configuration trigger as well as the main trigger showed below.)

EqualiseR's Customizable Terrain Kill System EqualiseR's Customizable Terrain Kill System
t_jm t_eve Events
t_lin t_jb Time - Every 0.05 seconds of game time
t_j t_co Conditions
t_jbm t_act Actions
     t_jbm t_if For each (Integer A) from 1 to 11, do (Actions)
         t_jbm t_act Loop - Actions
t_emp t_emp      t_j t_set Set HeroPosition[1] = ((Position of TerrainKill_Unit[(Integer A)]) offset by TerrainKill_Severity towards 90.00 degrees)
t_emp t_emp      t_j t_set Set HeroPosition[2] = ((Position of TerrainKill_Unit[(Integer A)]) offset by TerrainKill_Severity towards 180.00 degrees)
t_emp t_emp      t_j t_set Set HeroPosition[3] = ((Position of TerrainKill_Unit[(Integer A)]) offset by TerrainKill_Severity towards 270.00 degrees)
t_emp t_emp      t_j t_set Set HeroPosition[4] = ((Position of TerrainKill_Unit[(Integer A)]) offset by TerrainKill_Severity towards 360.00 degrees)
t_emp t_emp      t_j t_set Set HeroPosition[5] = (Position of TerrainKill_Unit[(Integer A)])
t_emp t_emp      t_jm t_if If (All Conditions are True) then do (Then Actions) else do (Else Actions)
t_emp t_emp t_emp t_lin t_jm t_co If - Conditions
t_emp t_emp t_emp t_lin t_lin t_jb t_if (Terrain type at HeroPosition[5]) Equal to Northrend - Snow
t_emp t_emp t_emp t_lin t_jm t_act Then - Actions
t_emp t_emp t_emp t_lin t_lin t_jbm t_if If (All Conditions are True) then do (Then Actions) else do (Else Actions)
t_emp t_emp t_emp t_lin t_lin      t_jm t_co If - Conditions
t_emp t_emp t_emp t_lin t_lin      t_lin t_j t_if (Terrain type at HeroPosition[1]) Equal to Northrend - Snow
t_emp t_emp t_emp t_lin t_lin      t_lin t_j t_if (Terrain type at HeroPosition[2]) Equal to Northrend - Snow
t_emp t_emp t_emp t_lin t_lin      t_lin t_j t_if (Terrain type at HeroPosition[3]) Equal to Northrend - Snow
t_emp t_emp t_emp t_lin t_lin      t_lin t_jb t_if (Terrain type at HeroPosition[4]) Equal to Northrend - Snow
t_emp t_emp t_emp t_lin t_lin      t_jm t_act Then - Actions
t_emp t_emp t_emp t_lin t_lin      t_lin t_jb t_uni Unit - Kill TerrainKill_Unit[(Integer A)]
t_emp t_emp t_emp t_lin t_lin      t_jb t_act Else - Actions
t_emp t_emp t_emp t_lin t_jb t_act Else - Actions
t_emp t_emp t_emp t_j t_wai Wait 0.01 seconds
t_emp t_emp t_emp t_j t_all Custom script: call RemoveLocation(udg_HeroPosition[1])
t_emp t_emp t_emp t_j t_all Custom script: call RemoveLocation(udg_HeroPosition[2])
t_emp t_emp t_emp t_j t_all Custom script: call RemoveLocation(udg_HeroPosition[3])
t_emp t_emp t_emp t_j t_all Custom script: call RemoveLocation(udg_HeroPosition[4])
t_emp t_emp t_emp t_jb t_all Custom script: call RemoveLocation(udg_HeroPosition[5])



~EqualiseR
t_emp
t_emp
Attachments
EqualiseR's TerrainKill System v3.0.w3x
(24.22 KiB) Downloaded 275 times
Last edited by EqualiseR on Mon Mar 11, 2013 11:25 pm, edited 3 times in total.
Image
User avatar
EqualiseR
 
Posts: 177
Joined: Mon Mar 21, 2011 2:38 pm
Realm: US East
Account: EqualiseR
Clan: 3ICE

Re: EqualiseR's Customizable Terrain-Kill System v3.0

New postby Ian on Fri Jun 01, 2012 6:00 pm

The Wait action needs to be removed.

http://i268.photobucket.com/albums/jj2/Sesamia/leaks.jpg

Just a simple test with debug messages will tell you that it can't keep up with the timer.

Wait actions are usually inaccurate and have trouble executing quickly with low numbers. As a general rule, .12-.26 is where it has trouble executing quickly (I don't think it can even function below .12 seconds). Waits also cause net traffic which can cause lag if you have enough of them being used at the same time (it can also depend on the host, as far as my experience with it goes anyway). You'll mostly find trouble with this on multiplayer.


Edit: There's also no reason to have any wait-time between creating and destroying the locations.
ʎɐqə ɯoɹɟ pɹɐoqʎəʞ ɐ ʎnq ı əɯıʇ ʇsɐl əɥʇ sı sıɥʇ


-Currently semi-inactive
User avatar
Ian
 
Posts: 76
Joined: Fri Aug 20, 2010 7:56 pm
Location: Minnesota
Realm: US East
Account: Sesamia
Clan: 3ICE

Re: EqualiseR's Customizable Terrain-Kill System v3.0

New postby 3ICE on Sat Jun 02, 2012 7:46 pm

Good job spotting that! Indeed, waits are not good at millisecond precision. I avoid everything below 0.27. If I need a precise short wait I use a timer. This trigger however, doesn't need any waits.

The concept is right. The execution is poor. (Because it's in GUI, and I generally don't expect anything great to come from GUI.)
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2099
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: EqualiseR's Customizable Terrain-Kill System v3.0

New postby EqualiseR on Mon Aug 27, 2012 6:14 pm

The reason there is a wait action implemented in this trigger is because without it there seems to be excessive leaks, and in an effort to try to prevent those leaks, I added the wait action which seemed to do the job, so I saw no reason to remove it.
Last edited by EqualiseR on Tue Aug 28, 2012 7:41 pm, edited 1 time in total.
Image
User avatar
EqualiseR
 
Posts: 177
Joined: Mon Mar 21, 2011 2:38 pm
Realm: US East
Account: EqualiseR
Clan: 3ICE

Re: EqualiseR's Customizable Terrain-Kill System v3.0

New postby 3ICE on Mon Aug 27, 2012 6:27 pm

EqualiseRthere seems to be excessive leaks, and in an effort to try to prevent those leaks, I added the wait action which seemed to do the job
That just makes me cringe. Excessive leaks are not fixed by adding waits, they are just hidden. You give the computer time so it can occupy more and more memory without slowing down... Until it runs out.

Without the wait the leaks were apparent. With the wait leaking still happens, but the problem is out of sight, out of mind.

I wish more people did what I do; Play your maps on a low end computer that barely meets the system requirements. Experience what it feels like to play your map in a cheap internet café in a poor third world country.

That's why we care about memory leaks. Accessibility.
Leaks crash the game. Our game doesn't crash because we have orders of magnitude more ram than required. Low end PCs don't.
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2099
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: EqualiseR's Customizable Terrain-Kill System v3.0

New postby Ian on Mon Aug 27, 2012 6:58 pm

You're not removing all of the leaks. At a second glance, I have found that you leak 4 additional locations (Position of TerrainKill_Unit[(Integer A)] 4 times in each polar projection function). Set HeroPosition[5] before your polar projection functions and use it instead of Position of TerrainKill_Unit[(Integer A)].
ʎɐqə ɯoɹɟ pɹɐoqʎəʞ ɐ ʎnq ı əɯıʇ ʇsɐl əɥʇ sı sıɥʇ


-Currently semi-inactive
User avatar
Ian
 
Posts: 76
Joined: Fri Aug 20, 2010 7:56 pm
Location: Minnesota
Realm: US East
Account: Sesamia
Clan: 3ICE


Return to HELP



Who is online

Users browsing this forum: No registered users and 2 guests

cron