• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A couple of questions.....

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
Q1: Do strings leak? If so is there a way to destroy string variables?

Q2: Is it possible to execute an action which is only present to a specifc player, an example is that I want to play a sound which can only be heard by Player 1 or setting up a weather effect which can only be seen only by one player.

Q3: Is there a way or system in which it detects whether if a unit takes normal damage, this does not include the "Unit - Damage Target" action and spell damages.

Q4: How to clean lightning effects properly?


Thanks in advance for the answers....:grin::grin:
 
Level 8
Joined
Apr 8, 2009
Messages
499
Q1: Do strings leak? If so is there a way to destroy string variables?

Q2: Is it possible to execute an action which is only present to a specifc player, an example is that I want to play a sound which can only be heard by Player 1 or setting up a weather effect which can only be seen only by one player.

Q3: Is there a way or system in which it detects whether if a unit takes normal damage, this does not include the "Unit - Damage Target" action and spell damages.

Q4: How to clean lightning effects properly?


Thanks in advance for the answers....:grin::grin:

1. yes, render string vars useless with:
  • Set YourString = <Empty String>
just entering a blank value will get <Empty String>

2. yes, i think you'll need some custom scripts. i did a specific player fade in/out for my map, and i think you'll need something like this.
  • Actions:
    • Custom script: if GetLocalPlayer()==p then
    • Custom script: HERE you'll need to put the things you want to happen in custom scripts, i can't help you there tho =\
    • Custom script: endif
3. you want to know if there's a way to determine the attack type of a attacking unit? as far as i know thats not possible with GUI =\, but wel, I'm not that experienced ^^

4. yes,
  • Custom script: CallDestroy Udg_VarName
for if you have given a var to the lightning effect,
I can't remember if this is correctly typed or even if it is the custom script you asked for, but oh wel i dont know anymore >_>

i hope this helped you ^^
 
Level 9
Joined
Oct 11, 2009
Messages
477
Questions 1 and 2 solved; thanks!!!

My problem in question 4 is that I created an MUI-Triggered Mana Burn, I want to clean the lightning effects independently by a way of a hashtable or any method and not by cleaning them at the same time because of one thing, it isMUI.
 
If you do it this way, it will not destroy them simultaneously:
  • One
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Burn
    • Actions
      • -------- --------------------------- --------
      • Set Points[1] = (Position of (Triggering unit))
      • Set Points[2] = (Position of (Target unit of ability being cast))
      • -------- --------------------------- --------
      • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) - 50.00)
      • Floating Text - Create floating text that reads |c00009999-50|r above (Target unit of ability being cast) with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
      • -------- --------------------------- --------
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Points[1] facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • -------- --------------------------- --------
      • Custom script: set udg_Light = AddLightningEx("FORK",true,GetLocationX(udg_Points[1]),GetLocationY(udg_Points[1]),GetLocationZ(udg_Points[1])+70,GetLocationX(udg_Points[2]),GetLocationY(udg_Points[2]),GetLocationZ(udg_Points[2])+70)
      • Hashtable - Save Handle OfLight as (Key light) of (Key (Last created unit)) in Hash
      • -------- --------------------------- --------
      • Trigger - Add to Two <gen> the event (Unit - (Last created unit) Dies)
      • -------- --------------------------- --------
      • Custom script: call RemoveLocation (udg_Points[1])
      • Custom script: call RemoveLocation (udg_Points[2])
  • Two
    • Events
    • Conditions
    • Actions
      • Lightning - Destroy (Load (Key light) of (Key (Triggering unit)) in Hash)
  • Hash
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
 
Level 9
Joined
Oct 11, 2009
Messages
477
Thanks to the three of you. Anyway I have one last problem, which is the question number 3. I want to know how to detect if a unit damages another unit normally and not by spell or trigger damage.
 
Level 7
Joined
Jun 6, 2010
Messages
224
Thanks to the three of you. Anyway I have one last problem, which is the question number 3. I want to know how to detect if a unit damages another unit normally and not by spell or trigger damage.

That's a complicated question.
Wc3 doesn't normally detect whether you take damage by attacks or even what type of damage it is. Making such a system would require you to make every single spell a dummy spell, and a series of complicated jass triggering.
 
Level 9
Joined
Oct 11, 2009
Messages
477
Can you give me an example on how to use the two functions... Cause I am always thinking of it as the function but I don't know how to use it.

I want to know it to detect the nearest/farthest unit/destructible from a specified location/point.
 
Status
Not open for further replies.
Top