• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Ok what have i done wrong

Status
Not open for further replies.
Level 6
Joined
Sep 2, 2005
Messages
234
Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( IsUnitAliveBJ(gg_unit_H001_0053) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call DialogDisplayBJ( true, returndialog(Hello), Player(0) )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Untitled_Trigger_001, 1.00 )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
 
Level 3
Joined
Aug 7, 2005
Messages
39
Event -
Time - Elapsed game time is 0.01 seconds
Condition -
(No Condition)
Actions -
Dialog - Change the title of (Variable) to (Random Title).
Dialog - Create a button for (Variable) labelled (Random Label).
Set (Random Label) = (Last created dialog button)
Dialog - Show (Variable) to Player 1.

(Variable) = Dialog (New Dialog (Default))
You can choose any other event, but this is a basic one that should work. This is about the system that i am using in my TD. By using the "Set" action you can create another trigger in which to do something like this.

Event -
Dialog - A dialog button is clicked for (Variable).
Condition -
(No Condition)
Actions -
(Random Actions)

With this trigger, in the actions section, you can enable it to spawn a builder for you or any other sort of thing. Things you probably already know. Just felt like explaining myself. Tell me if it helps. :D
 
Level 3
Joined
Aug 7, 2005
Messages
39
You mean like a dialog box with dialog buttons such as, footman, grunt, ghoul, and archer?
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
jass or jazz as i call it(because used to always mispell it and now i just call it that anyway) is the code language that triggers are made of. basically trigger are an easy to use version of jazz where everything clicks into place,like legos. one lego clicks into another and tthat is easy but what the legos are made of is not. i hope i didnt talk too much jibberish there, if anyone has a better explaination please tell him :wink:
 
Level 3
Joined
Aug 7, 2005
Messages
39
Well, you can alter the sample dialog i have presented to create units for you. All you would have to do is this:

Event -
Time - Elapsed game time is 0.01 seconds
Condition -
(No Condition)
Actions -
Dialog - Change the title of ExampleDialog to Choose a Unit.
Dialog - Create a button for ExampleDialog labelled Footman.
Set ButtonFootman = (Last created dialog button)
Dialog - Show (Variable) to Player 1.

ExampleDialog would be a variable in this case.

Event -
Dialog - A Dialog Button is clicked for ExampleDialog.
Condition -
Dialog Button Comparison - Dialog Button eqaul to Footman.
Action -
Create - Create 1 Footman for Player 1 (Red) (Center of (Region 000))

From these triggers, the dialog box will automatically spawn you a footman when you click on the 'Footman' Dialog Button. Any Questions?
 
Status
Not open for further replies.
Top