Convert Destructable to Triggering player!

Saintbob

New Member
Reaction score
2
Hey guys/gals

Im a little stuck on understanding how to convert a destructable to a player ownd destructable.

Let me explain.

I have a unit that will cast an ability on the destructable called Infest, that will then take 10seconds to cast, when the cast has ended, i want the destructable to become owned by the player casting the ability.
I also want the the new infested destructable to have increased HP and Armor, and lastely so that the player casting the ability cannot cast it on another Human player owned Destructable.
But i do want the other player to be able to destroy the destructable.

Any ideas?

Thanks all.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
omg just make a unit and remove his attack and add destructable's model.
you ability is channeled, so at event you write a unit finishes casting an ability
the condition must check if the unit "Infested" is the target of the spell.
make an if then else to check if another player owns the unit and then kill it or else you change the unit's owner to the player that casted the ability.Then add some passives that increase the damage and other stats you want of the unit.

Search the triggers man, you will find more interesting comands.
 

Saintbob

New Member
Reaction score
2
omg just make a unit and remove his attack and add destructable's model.
you ability is channeled, so at event you write a unit finishes casting an ability
the condition must check if the unit "Infested" is the target of the spell.
make an if then else to check if another player owns the unit and then kill it or else you change the unit's owner to the player that casted the ability.Then add some passives that increase the damage and other stats you want of the unit.

Search the triggers man, you will find more interesting comands.

Forgive me, but my knowledge of these triggers are quite slim, im ok with basic triggers. But i've not created anything like this before.

How do you mean by Make a unit and remove its attack, and add Destructables model?

Why cant i just create a spell that when attacks the Destructable it turns it into the triggering players building, if not already owned by another player?
And how do i then go onto making that destructable gain HP and increase in defence when i take over it?

Sorry for been dumb, but i cant find any tutorials on this type of triggering.

Thanks :D
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
destructables and units (buildings count as units) have nothing in common, they are completely different, you cant just own a destructable.
what you have to do is creating a new unit in the object editor and change its values/graphics to look like the destructable you were referring.
now either you remove the target destructable of your ability and create that new unit type at its position instead or you just swap all your destructables with the new unit type by default and refer to them as "wanna be" destructables.
if you have many destructables of that kind you are talking about i would recommend the first method else the second.
 

Saintbob

New Member
Reaction score
2
destructables and units (buildings count as units) have nothing in common, they are completely different, you cant just own a destructable.
what you have to do is creating a new unit in the object editor and change its values/graphics to look like the destructable you were referring.
now either you remove the target destructable of your ability and create that new unit type at its position instead or you just swap all your destructables with the new unit type by default and refer to them as "wanna be" destructables.
if you have many destructables of that kind you are talking about i would recommend the first method else the second.

So what you're saying is...

The Spell I have "infest" will 1 shot the destructable, then set it in the triggers to so that when the spell "infest" 1 shots the destructable it will replace that with my new unit that looks like the destructable, in its place?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
kinda. can you code that by yourself? try it and post the code here, we can help you for sure.
 

Saintbob

New Member
Reaction score
2
kinda. can you code that by yourself? try it and post the code here, we can help you for sure.

Trigger:
  • Events
    • unit - a unit finishes casting ability

Trigger:
  • Condition
    • (Ability being cast) Equal to Infest

Actions
Trigger:
  • Unit - Replace (target unit of ability being cast) with a Infestered Stone using The new unit's max life and mana



sorry for the crap posting of the triggers, first time i've posted anything here using those tags. lol

Thats what im using, but it doesnt work
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
first of all, to copy the trigger as a whole just right-click the triggers name and copy as text and paste here instead of copying the events, conditions and actions one by one.
like if your trigger is called "MyVeryFirstTrigger" you have to select the "MyVeryFirstTrigger" text and copy as text:
Trigger:
  • MyVeryFirstTrigger
    • Events
      • Map initialization
    • Conditions
      • True Equal True
    • Actions
      • Do nothing

bold in this conotation:
Code:
[B][I]MyVeryFirstTrigger[/I][/B]
    Events
        Map initialization
    Conditions
        True Equal True
    Actions
        Do nothing

now to your problem, using (target unit of ability being cast) will obviously not work because the target of the ability is a destructable and not a unit.
what you need should look somewhat like this:
Trigger:
  • MyVeryFirstTrigger
    • Events
      • Unit - A unit starts the effect of an Ability
    • Conditions
      • (Ability being cast) Gleich MyAbility
    • Actions
      • Set TempPoint = (Position of (Target destructible of ability being cast))
      • Destructable - Remove (Target destructible of ability being cast)
      • Unit - Create 1 MyUnitType for (Owner of (Triggering unit)) at TmpPnt facing 270.00 degrees
      • Custom script: call RemoveLocation (udg_TempPoint)

if you wonder:
MyAbility is the custom ability of yours
MyUnitType is the type of the new unit which you want the destructable to be replaced with
TempPoint is a point variable which is needed to avoid memory leaks
the custom script line is needed to avoid memory leaks together with the point
 

Saintbob

New Member
Reaction score
2
now to your problem, using (target unit of ability being cast) will obviously not work because the target of the ability is a destructable and not a unit.
what you need should look somewhat like this:

Trigger:
  • Trigger:
    • MyVeryFirstTrigger
    • Events
    • Unit - A unit starts the effect of an Ability
    • Conditions
    • (Ability being cast) Gleich MyAbility
    • Actions
    • Set TempPoint = (Position of (Target destructible of ability being cast))
    • Destructable - Remove (Target destructible of ability being cast)
    • Unit - Create 1 MyUnitType for (Owner of (Triggering unit)) at TmpPnt facing 270.00 degrees
    • Custom script: call RemoveLocation (udg_TempPoint)


if you wonder:
MyAbility is the custom ability of yours
MyUnitType is the type of the new unit which you want the destructable to be replaced with
TempPoint is a point variable which is needed to avoid memory leaks
the custom script line is needed to avoid memory leaks together with the point

ok so ive tried this and this is the best i can come up with lol, sorry for the fail attempt!

Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infest (Warlock)
    • Actions
      • Set Destructable = (Last created destructible)
      • Destructible - Remove (Target destructible of ability being cast)
      • Unit - Create 1 Infestered Stone for (Triggering player) at (Position of (Target destructible of ability being cast)) facing Default building facing degrees


I cant get my head arround the Variable, and the Custom script you've done.
Could ya explain how to do them both?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
ok so ive tried this and this is the best i can come up with lol, sorry for the fail attempt!

Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infest (Warlock)
    • Actions
      • Set Destructable = (Last created destructible)
      • Destructible - Remove (Target destructible of ability being cast)
      • Unit - Create 1 Infestered Stone for (Triggering player) at (Position of (Target destructible of ability being cast)) facing Default building facing degrees


I cant get my head arround the Variable, and the Custom script you've done.
Could ya explain how to do them both?

nothing you have to be sorry about.

first of all, your trigger cannot work cause there is no position of a targeted destructable after you removed the destructable one line before. your trigger should "work" if you switch both lines.

about the TempPoint, this is something about wc3 triggering which is rather hard to understand for beginners. each time you use a certain type of variable, points, unitgroups, forces, rects, special effects, you lose a little memory. this memory can only be freed with a custom script line like i did.
if you dont remove memory leaks in your triggers they might cause your map to lag after they ran frequently because your computer will run short on memory.

Edit: Added a demo map
 

Attachments

  • [Z]MorphDestructableIntoUnit.w3x
    17.7 KB · Views: 115
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top