wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > General Development
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 05-14-2018, 08:04 PM   #1
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 147

andreasaspenberg is on a distinguished road (12)

Default how can i make a building activate by a buff

in my map i have a star gate which i want to require a DHD to work. the DHD uses a buff called DHD power but it is not working properly. how can i get the buff to make the stargate activate when the DHD is present but go inert when it is absent?
andreasaspenberg is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 05-16-2018, 08:22 PM   #2
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,189

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Is DHD power given by an aura? Did you set up the aura so that it can target structures? What kind of triggers do you have checking for the buff, can you post them?
__________________
Anitarf is offline   Reply With Quote
Old 05-17-2018, 06:53 PM   #3
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 147

andreasaspenberg is on a distinguished road (12)

Default

yes, it is provided by an aura. it does target the stargate. here is the trigger:
Trigger:
DHD power
Collapse Events
Time - Every 2.00 seconds of game time
Collapse Conditions
this one is not active ((Random unit from (Units in (Playable map area))) has buff DHD power ) Equal to True
Collapse Actions
Collapse Unit Group - Pick every unit in (Units of type Stargate level 1) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has buff DHD power ) Equal to True
Collapse Then - Actions
Unit - Change ownership of (Picked unit) to (Owner of (Ordered unit)) and Change color
Collapse Else - Actions
Unit - Change ownership of (Picked unit) to Neutral Passive and Change color

Last edited by Anitarf : 05-17-2018 at 08:15 PM.
andreasaspenberg is offline   Reply With Quote
Old 05-17-2018, 08:14 PM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,189

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

The disabled condition should be removed altogether, it is not relevant and will only cause the trigger to fail if you enable it.

The error that I see is that you use "(Owner of (Ordered unit))". "(Ordered unit)" is an event response that can only be used in triggers with an order event. You should use a different method of picking the new owner. Also, make sure your power aura can also target neutral units or you will never be able to power a Stargate again once it becomes unpowered.

Edit: I've edited your post and put the trigger in [trigger] tags, that way it is easier to read.
__________________

Last edited by Anitarf : 05-17-2018 at 08:15 PM.
Anitarf is offline   Reply With Quote
Old 05-17-2018, 09:57 PM   #5
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 147

andreasaspenberg is on a distinguished road (12)

Default

i tried casting unit as well and that did not work. instead of editing my post you should instead send me a pm and inform me how i can format the trigger. you scared my away now by being rude.
andreasaspenberg is offline   Reply With Quote
Old 05-18-2018, 06:43 AM   #6
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

Where was Ani rude at all?

Anyway, I don't think you are able to get the owner of the aura without triggering the whole thing (good luck in gui).

I assume you're trying to create a pylon type power thing (if wrong, ignore but ideally actually state what you're trying to do when you post a problem). Instead of changing owners when a building gets unpowered I would just disable/pause it. That way don't have to figure out who owns the power aura, you just have to re-enable/unpause.

Last edited by Fledermaus : 05-18-2018 at 06:52 AM.
Fledermaus is offline   Reply With Quote
Old 05-19-2018, 07:40 PM   #7
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,189

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I was trying to be helpful with the edit, doing this has never been an issue before.

As Fledermaus said, if you want any player to be able to take control of an unpowered building by powering it, this will be more difficult to achieve because there is no way to get the source of an aura buff with triggers. When a building becomes powered, you could do a search for an aura source in a radius around the building, but what if you find more than one source (for example, if two players completed a power source within the last 2 seconds)? No way to tell who was first. It becomes even more difficult if the power sources are mobile, it's not clear from your posts if they are or not.

As noted, a different implementation where buildings can't change owners would be easier to implement, would that be acceptable?
__________________
Anitarf is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:10 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services