Is this trigger or smth possible?

dnc123

New Member
Reaction score
0
OK I`m on my first map project called Zombie infection,and I would like to know is it possible to write trigger or variable that would make this:
my custom builder to build a 4 pixel or 4grid or whatever that is,tree wall,which would be cutable(get wood from those trees) and at the same time able to destroy it by pressing RMB.or something like that,hope someone helps :) if needed more info,ask,Il try to answer as soon as I can...
 

Sevion

The DIY Ninja
Reaction score
413
The only possible way is to detect when players build buildings and check for the building type. If it's your building type then destroy it and create a tree destructable there.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, it isn't too easy to do the RMB stuff, but why not the LMB :eek:

If that's an option, why not create a trackable at every destructible (This is quite inefficient though, I'd believe) and register a click event for them ;)
 

Kajik

New Member
Reaction score
4
I think you can use
EVENT_UNIT_ISSUED_TARGET_ORDER
to recognize right-clicking and then filter your tree via conditions.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
But then you need to have a unit selected...

Don't really know which he needs :S XD But yeah, that works :D
 

dnc123

New Member
Reaction score
0
I`m working first week with this map editor program so doing this may be a bit hard,but I`l try to do as you say.thanks for help already,It doesn`t matter for me to do it with RMB or LMB...all I want is my builder to be able to build a wall out of trees and it would be destructuble...
 

dnc123

New Member
Reaction score
0
I am almost finished with tree creation I just don`t understand how to make ability to target terrain/ground or whatever it can be called like,I mean I tried almost all "Stats - targets allowed" but none worked,so I would be happy if someone would help me with this...

----Other problem----

I`m making market and I have already did almost all commands,but I can`t find one condition command,I need condition command which makes "if player casting ability player has equal or greater than 100 of current gold" or smth like that,anyways,here is how my trigger looks like now:

Trigger:
  • Events
    • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Gold to Lumber
    • Actions
      • Player - Add 90 to (Owner of (Casting unit)) Current lumber
      • Player - Add -100 to (Owner of (Casting unit)) Current gold
 

dnc123

New Member
Reaction score
0
Ok,I was thinking and trying kajik`s and Komaqtion`s suggestions,but I didn`t found a way to use any of those,by the way,I have fixed the problem written above with tree...now I can place a tree with ability within 500range on ground...So can anyone explain me their ideas and how to do it,cause I`m going to the end with my map now all I need to do to continue work is how to make damageable 1type of tree and to end the thing with market.thanks...
 

Kajik

New Member
Reaction score
4
..."if player casting ability player has equal or greater than 100 of current gold" or smth like that...

Trigger:
  • Events
    • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Gold to Lumber
      • ((Owner of (Triggering Unit)) Current Gold) Greater than or equal to (>=) 100
    • Actions
      • Player - Add 90 to (Owner of (Casting unit)) Current lumber
      • Player - Add -100 to (Owner of (Casting unit)) Current gold

You can find it under:
Conditions -> Integer Comparison - > Player - Property -> and then set the options as you can see above.


And to your tree problem: Since this is JASS Help forum thread, I tought you are working in JASS. With GUI, I could help you, but please...explain once more, what you already did and what exactly do you want to achieve.
 

dnc123

New Member
Reaction score
0
Ok,first of all I am just a beginner of using this program I really thought its JASS,I`m using the one which edits map with those trigger "a" commands.
So now I would like you to explain me few things
1)What is changes between JASS and "a" and can you write me the name of "a".
2)About the tree:My current "a" command with tree is
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grow tree
    • Actions
      • Destructible - Create a Ashenvale Tree Wall (Im gonna change the tree into other) at (Target point of ability being cast) facing (Random angle) with scale 1.00 and variation 0


3)I don`t know what,but I`m really doing something bad with Market thing,I mean whole trigger and ability looks perfect but something don`t actually works and I think its with trigger.
Trigger:
  • Events
    • Unit - A unit Begins casting an ability
    • Conditions
    • (Ability being cast) Equal to Gold to Lumber
    • Actions
    • Player - Add 90 to (Owner of (Casting unit)) Current lumber


Ability(I`l write only data and stats of it,I think art isnt needed...):
Data - Base Order ID neutralspell
Data - Charge Owning Player True
Data - Gold Cost 100
Data - Lumber Cost 0
Stats - Area of Effect 0.00
Stats - Buffs "None"
Stats - Cast Range 0.00
Stats - Casting Time 0.00
Stats - Cooldown 0.00
Stats - Duration - Hero 0.00
Stats - Duration - Normal 0.00
Stats - Effects "None"
Stats - Hero Ability False
Stats - Item Ability False
Stats - Levels 1
Stats - Mana Cost 0
Stats - Priority for Spell Steal 0
Stats - Race Human
Stats - Targets Allowed "None"
 

Kajik

New Member
Reaction score
4
You can make triggers in GUI (Graphic User Interface)
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-Type of (Triggering Unit)) Equal to (==) Footman
    • Actions
      • Player - Set (Owner of (Triggering Unit)) Current gold to 0

or convert it to JASS, which is some kind of programming language behind World Efitor. The example above converted to JASS would be:
JASS:

function Trig_GUI_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true
endfunction

function Trig_GUI_Actions takes nothing returns nothing
    call SetPlayerStateBJ( GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, 0 )
endfunction

//===========================================================================
function InitTrig_GUI takes nothing returns nothing
    set gg_trg_GUI = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_GUI, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_GUI, Condition( function Trig_GUI_Conditions ) )
    call TriggerAddAction( gg_trg_GUI, function Trig_GUI_Actions )
endfunction

Menu "Edit"->"Convert to Custom Text" will do the trick.
I am not going to explain you the JASS advantages, there is bunch of turorials about it...

To your tree problem:
In object editor, make an ability based of Channel. You can also read some tutorials about how to use channel. Simpy put, it's most used base ability when you want to trigger it's effect on your own. You should change
  • "Data - Target Type" field (in your case this should be "Instant - No Target")
  • "Data - Base order ID" field (just make sure unit doesn't have two abilities with the same base order ID)
  • "Data - Options" field (check "Visible", otherwise you would't see the spell ingame)
Then experiment, you have to know which fields influents your ability and in which way.

Your trigger seems totaly fine to me, there shouldn't be any problem. Just make sure that condition
Trigger:
  • Conditions
    • (Ability being cast) Equal to Gold to Lumber

realy refer to the right ability.
 

dnc123

New Member
Reaction score
0
You can make triggers in GUI (Graphic User Interface)
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-Type of (Triggering Unit)) Equal to (==) Footman
    • Actions
      • Player - Set (Owner of (Triggering Unit)) Current gold to 0

or convert it to JASS, which is some kind of programming language behind World Efitor. The example above converted to JASS would be:
JASS:

function Trig_GUI_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true
endfunction

function Trig_GUI_Actions takes nothing returns nothing
    call SetPlayerStateBJ( GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, 0 )
endfunction

//===========================================================================
function InitTrig_GUI takes nothing returns nothing
    set gg_trg_GUI = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_GUI, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_GUI, Condition( function Trig_GUI_Conditions ) )
    call TriggerAddAction( gg_trg_GUI, function Trig_GUI_Actions )
endfunction

Menu "Edit"->"Convert to Custom Text" will do the trick.
I am not going to explain you the JASS advantages, there is bunch of turorials about it...

To your tree problem:
In object editor, make an ability based of Channel. You can also read some tutorials about how to use channel. Simpy put, it's most used base ability when you want to trigger it's effect on your own. You should change
  • "Data - Target Type" field (in your case this should be "Instant - No Target")
  • "Data - Base order ID" field (just make sure unit doesn't have two abilities with the same base order ID)
  • "Data - Options" field (check "Visible", otherwise you would't see the spell ingame)
Then experiment, you have to know which fields influents your ability and in which way.

Your trigger seems totaly fine to me, there shouldn't be any problem. Just make sure that condition
Trigger:
  • Conditions
    • (Ability being cast) Equal to Gold to Lumber

realy refer to the right ability.

Ok first of all it took me a 30mins to understand that im not gonna understand what you have just written,so I recorded a video showing my current abilities,stats,etc...so watch it and tell me these things:
1)About channeling:what is this,cause I were searching for many tutorials in:google,youtube,this site,and didn`t found any,so I tried looking for ability called channel,I found one and made it non hero ability,so tell me what should I do further with that ability
2)My "Lumber to gold mistakes,I don`t want change current language into programing cause I know very not much basics in it...so why that skill doesn`t work thank you very much for your help,is there a rep system in this site? I would give you one if there is...

oh right...the link :D : http://www.youtube.com/watch?v=qLW8MnqW28Y
 

Tyman2007

Ya Rly >.
Reaction score
74
The rep button is at the top right of a user's post that looks like scales.

Although, if you didn't want to use Jass then why are you posting in the Jass help section? :p

But I think I found your problem.. Abilities cannot have a lumber cost, so I suppose you're not using an ability there, thus "Begins casting" or "Starts the effect of" won't work.

Make sure you're actually using the ability and not some unit or upgrade.
 

Kajik

New Member
Reaction score
4
Man, Im not going to watch some low quality blurred video and try to reconstructe your problem. Attach or save somewhere your map. I will download it and check your problems.
AFAIK you want
1) builder with the ability, which will make a simple tree (or buch of trees??) at target point
2) if some special unit (zombie or enemy unit in general) righ-click on this tree, it should be destroyed (you can't simply destroy it on right-clicking, because then you can't harvest with your builder - or only via the harvest ability)
3) ability to turn 100 gold to 90 lumber (who have this ability? The builder, some hero, neutral building??)

Am I right?
 

dnc123

New Member
Reaction score
0
The rep button is at the top right of a user's post that looks like scales.

Although, if you didn't want to use Jass then why are you posting in the Jass help section? :p

But I think I found your problem.. Abilities cannot have a lumber cost, so I suppose you're not using an ability there, thus "Begins casting" or "Starts the effect of" won't work.

Make sure you're actually using the ability and not some unit or upgrade.

look at the video,the ability is at ability section,so thats ability I think...
 

dnc123

New Member
Reaction score
0
Man, Im not going to watch some low quality blurred video and try to reconstructe your problem. Attach or save somewhere your map. I will download it and check your problems.
AFAIK you want
1) builder with the ability, which will make a simple tree (or buch of trees??) at target point
2) if some special unit (zombie or enemy unit in general) righ-click on this tree, it should be destroyed (you can't simply destroy it on right-clicking, because then you can't harvest with your builder - or only via the harvest ability)
3) ability to turn 100 gold to 90 lumber (who have this ability? The builder, some hero, neutral building??)

Am I right?

there is a pixel(as I understood) button on youtube which makes video graphic much better,press 720p and full screen,and vuolia,you got a good enough graphics to easily see all problems...
Ok,nwm I did as you said,here is the link of my map: http://www.megafileupload.com/en/file/245647/Zombie-Infection-w3x.html
1)simple tree
2)ok than I want it uncutable,but destroyable by damage...(unit damage hits tree hp)
3)a house,umm maybe its a unit...I don`t know what is it,its just a market
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top