[General] Need help with triggers/LoS/path

Status
Not open for further replies.
Level 2
Joined
Jul 17, 2013
Messages
4
Hi there! Just registered, is the website still active? ^^

Anyways, I need help with the triggers and path/reach thingy.

1. I need to make an event that releases/spawns a boss if you destroy a particular doodad or Unit (statue, building, special units, etc)

2. I need a trigger that removes a wall after X seconds. For example, the stone wall is blocking a entrance that will be revealed after X seconds.
I hope you understand, lol.

3. Last question! I need to block the line of sight. So the catapults with super long range can't shoot enemies behind the high mountains or walls.

Thanks!
//Falter
 
Level 28
Joined
Sep 26, 2009
Messages
2,545
You are too vague, so I can't post anything better.

#1
  • Boss Spawn
    • Events
      • Destructible - Your_Destructible dies // use this when you want destructible to fire the event
      • -or-
      • Unit - Your_Unit Dies // use this when you want unit to fire the event
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set p = (Center of Your_region)
      • Unit - Create 1 Your_Boss for Your_Player at p facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_p)
Note: For this to work, that statue/wall/door has to be a destructible. If it is doodad, it won't help.
"p" is a point variable. You use this variable to set the location. Then you create unit at "p". After you create the unit, you need to use custom script (just copy and paste it; if you name the variable differently, change it also in the custom script - e.g. if you name "p" as loc, then change udg_p in the custom script to udg_loc)

#2
  • Timed Event
    • Events
      • Time - Elapsed game time is Your_Time_Here seconds
    • Conditions
    • Actions
      • Destructible - Kill Your_Destructible
Again, for this to work, that thing that blocks your path has to be destructible, not doodad.

#3
This may be a lot harder than it seems imo and it depends on how you create the map itself.
 
Last edited:
nichilus u leak a point which should be taken care of. u should always post efficient triggers for newer ppl so that they can learn the right ways to do things.
if he doesnt know y u did that then u can point him to the things that leak tutorial and my tutorial things a guier should know if deemed necessary.
and any others u may find suitable to posting for the newcomer
 
Level 28
Joined
Sep 26, 2009
Messages
2,545
since when does "Center of region" leak? I understand random point of region, but I thought that center of region was save lol.

Both triggers are efficient. I wrote I can't post anything better as to emphasize that he is way too vague with his request.

Too vague:
"I need to make an event that releases/spawns a boss if you destroy a particular doodad or Unit (statue, building, special units, etc)"
the whole request is too general, didn't give anything really specific, but I don't know - maybe he wants a "general spawn trigger" and the trigger I posted does take care of it.

Example of what I imagine as a detailed request:
"When you destroy the Emperor unit, a fiery pentagram consisting of "fire small" doodads is created in the center of throne room over 5 seconds and then an explosion occurs, which kills all player units in the pentagram. After explosion boss appears on the pentagram and "fades in" over 2 second, then roars and finally attacks enemies."
- as you can see, from this description you get the idea of what exactly I want.

---
anyway, if center of region really leaks, I will update my previous post.
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
3. Last question! I need to block the line of sight. So the catapults with super long range can't shoot enemies behind the high mountains or walls.

Use Line of Sight blockers? Tho it may be really hard if there's an allied unit behind the other mountain/wall.

anyway, if center of region really leaks, I will update my previous post.

Any location point leaks afaik.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
For the 3rd problem, create a region to cover all the area that u want the catapult not to shoot it. Then create a triggger with unit - unit is attacked, condition attacked unit is in region, unit type of attacking unit equal to catapult and attacking unit isnt in region, action order attacking unit to stop.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,273
the leak is inefficient.
Leaks have nothing to do with efficiency. A leak is a fault.

You can have very efficient code that leaks, you can also have leak-less code that is very inefficient. Programmers never intend code to leak, as such any leak that does occur is a fault with their program and any degradation of performance as a result of said leak cannot be counted towards efficiency as the program is not behaving as intended.

For people unsure of the problem of a leaks and why you should fix them, I give a an analogy...
A printing house prints newspapers every day. Newspapers are normally recycled into more newspapers or other things after they have been used. The printing house then decides to improve the quality of printed newspapers so they are completely indestructible and will exist until the end of time. If they then continues printing, newspapers start to build up. After a month streets become littered with their papers. After a year many streets becomes buried by their newspapers. In a decade some cities have become covered with their newspapers. In a century some countries are covered under newspaper. In a millennium all of the earth surface is covered by newspaper. In a million years 99% of the earth's mass is newspapers.

Those newspapers are acting like computer memory. Normally it is allocated, used and then freed so it can be used again for some other purpose. However, if you make the memory allocation permanent (the newspaper indestructible) then the allocated memory amount starts to build up. Eventually it builds up so much that performance is forced to degrade (people walking over all the newspaper everywhere). Eventually it will lead to a crash (the entire planet is newspapers).

WC3 does not really suffer from the quantity of allocated memory when trigger leaks occur, but more from procedural leaks tied to the leaking structures and finite resource depletion. Excessive string leaks (an unfixable leak in WC3) will eventually make future string operations perform so slow that a single call can drop several frames. Allocating too many handles will deplete the handle address range causing all kinds of errors, even though the process still has tons of free memory (not an out of memory error).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,273
Making trigger efficient does not equal to making newspaper indestructible, that was a bad example, mehehe ;) but we get your point...
I never said it was. I was saying that making the newspaper indestructible is like making an object leak. In fact the entire post was saying how that has nothing to do with efficiency yet here you are saying I said something else...

Fact is a leak is a programming fault, no one ever writes a program with the intention that it will leak memory. Leaks cannot be related to efficiency as they are the result of faulty code and the efficiency of faulty code does not mater as it is failing to behave as expected.
 
Level 2
Joined
Jul 17, 2013
Messages
4
Awesome, thanks alot guys!

"You are too vague" Yeah, sorry about that. I'm new to making my own map and stuff and I didn't really know how to explain it better :)
 
Status
Not open for further replies.
Top