(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Tutorials > Trigger (GUI) Editor Tutorials

Trigger (GUI) Editor Tutorials Contains tutorials concerning the usage of GUI features.
Read the Rules before posting.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 10-04-2007, 10:22 PM   #1 (permalink)
 
Saitek009's Avatar

The shortest Sith
 
Join Date: Jun 2007
Posts: 63

Saitek009 is on a distinguished road (64)Saitek009 is on a distinguished road (64)


Gamespeed Keys

SpeedKeys


Have you ever wanted to have more detectable keys without using a third-party program?
Well here is a single-player solution that uses the game-speed increase and decrease keys, "+" and "-".
Just put the trigger in your map, your preference GUI or JASS and then put your trigger actions after the marked point.
With the Demo it adds gold with the "+" key and subtracts gold with the "-" key.


GUI
SpeedKeys GUI
Events
Time - Every 0.30 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current game speed) Equal to Normal
Then - Actions
Game - Set game speed to Slow
-------- Put your actions for the "+" key after this point --------
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current game speed) Equal to Slowest
Then - Actions
Game - Set game speed to Slow
-------- Put your actions for the "-" key after this point --------
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) - 1)
Else - Actions
Do nothing
Add this to your initialization trigger
Game - Set game speed to Slow



JASS
function Trig_SpeedKeys_JASS_Actions takes nothing returns nothing
    if GetGameSpeed() == MAP_SPEED_NORMAL then
        call SetGameSpeed(MAP_SPEED_SLOW)
        //Put your actions for the "+" key after this point
        call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD)+1)
    elseif GetGameSpeed() == MAP_SPEED_SLOWEST then
        call SetGameSpeed(MAP_SPEED_SLOW)
        //Put your actions for the "-" key after this point
       call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD)-1)
    endif
endfunction

function InitTrig_SpeedKeys_JASS takes nothing returns nothing
    set gg_trg_SpeedKeys_JASS = CreateTrigger()
    call TriggerRegisterTimerEventPeriodic(gg_trg_SpeedKeys_JASS, 0.3)
    call TriggerAddAction(gg_trg_SpeedKeys_JASS, function Trig_SpeedKeys_JASS_Actions)
    call SetGameSpeed(MAP_SPEED_SLOW)
endfunction

NOTE: Game-speeds are a little strange in Wc3
Fast In-game == Normal in WE
Normal In-game == Slow in WE
Slow In-game == Slowest in WE
That is why the setting are as they are.


Due to the unique nature of the game-speed change keys you can actually hold down the + or - key
and it will keep on doing the triggered action over and over, unlike ability hot keys.
But again, this is only usable in single player.

Have fun,
-Saitek
Attached Files
File Type: w3x SpeedKeys.w3x (17.0 KB, 50 views)
Saitek009 is offline  
Old 10-04-2007, 10:58 PM   #2 (permalink)
 
ragingspeedhorn's Avatar

Condemned Entertainment
 
Join Date: Apr 2005
Posts: 6,566

ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)

Paired Mapping Contest #3 Winner: Warcraft Arena Paired Mapping Contest #2 Winner: Hell Scream's Party Cinematic Mini-Contest #1 Winner: The Escape & The Premonition Mini-Game Contest #1 Winner: Pirate Tag! 

Only usable in single player and you cannot use gold (in your example) in the map, that is not very handy.
ragingspeedhorn is offline  
Old 10-04-2007, 11:35 PM   #3 (permalink)
 
Xarwin's Avatar

Inner peace and harmony
 
Join Date: Nov 2006
Posts: 1,603

Xarwin is a jewel in the rough (189)Xarwin is a jewel in the rough (189)

PayPal Donor: This user has donated to The Hive. 

Try using integers instead.
__________________
Xarwin is offline  
Old 10-05-2007, 01:15 AM   #4 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,908

PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

Raging, I think +/- 1 gold was his example effect.
PurplePoot is offline  
Old 10-05-2007, 07:50 AM   #5 (permalink)
 
ragingspeedhorn's Avatar

Condemned Entertainment
 
Join Date: Apr 2005
Posts: 6,566

ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)ragingspeedhorn is a name known to all (701)

Paired Mapping Contest #3 Winner: Warcraft Arena Paired Mapping Contest #2 Winner: Hell Scream's Party Cinematic Mini-Contest #1 Winner: The Escape & The Premonition Mini-Game Contest #1 Winner: Pirate Tag! 

Wasn't it supposed to increase/decrease gamespeed? What does that have to do with gold, I am confused.
ragingspeedhorn is offline  
Old 10-05-2007, 10:58 PM   #6 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,908

PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

No, +/- increases/decreases gamespeed.

He was showing how to manipulate that to detect when they're pressed.
PurplePoot is offline  
Old 10-18-2007, 10:33 PM   #7 (permalink)
 
Saitek009's Avatar

The shortest Sith
 
Join Date: Jun 2007
Posts: 63

Saitek009 is on a distinguished road (64)Saitek009 is on a distinguished road (64)


Sorry I haven't replied. All this does is make the + and - keys detectable.
The adding gold thing is just an example.
Try it out and it'll make sense.
__________________
Do you sue the jawbreaker company if you eat
a jawbreaker and it breaks your jaw or if
you eat one and it doesn't?
? ?
Saitek009 is offline  
Old 10-19-2007, 04:08 AM   #8 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,908

PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

I'm wondering whether this is actually practical enough to be worthwile.

Arrow Keys are fine in Single Player, as is Esc, so it's not that necessary.

Meh, we'll see what others have to say.
PurplePoot is offline  
Old 10-20-2007, 12:43 AM   #9 (permalink)
 
Saitek009's Avatar

The shortest Sith
 
Join Date: Jun 2007
Posts: 63

Saitek009 is on a distinguished road (64)Saitek009 is on a distinguished road (64)


I guess it's just if you need more than the arrows and Esc.
That's why Wc3: WoW is going to use it.
__________________
Do you sue the jawbreaker company if you eat
a jawbreaker and it breaks your jaw or if
you eat one and it doesn't?
? ?
Saitek009 is offline  
Old 02-06-2008, 09:48 PM   #10 (permalink)
Overall Site Manager
 
Wolverabid's Avatar

 
Join Date: Oct 2006
Posts: 8,756

Wolverabid has much of which to be proud (1208)Wolverabid has much of which to be proud (1208)

Respected User: This user has been given the respected user award. User of the Year: 2007 

Thumbs up Tutorial Approved!

Creators of single player maps and campaigns should find this little trick to be both handy and useful. Extra hotkeys? Sign me up!

» REP DUMP «

~ Thread moved to Trigger (GUI) Editor Tutorials.
Wolverabid is offline  
Old 02-06-2008, 11:04 PM   #11 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,908

PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)PurplePoot is a name known to all (737)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

Erm.

~Thread moved to Trigger (GUI) Editor Tutorials :P
PurplePoot is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run maps with high gamespeed MindWorX Miscellaneous Tutorials 14 11-30-2008 07:37 AM
Camera and Arrow Keys. Black Mamba World Editor Help Zone 6 08-08-2007 06:24 AM
Piano Keys Pyritie Requests 5 06-18-2007 08:59 PM
Binding custom keys to arrow-keys? -BlackKnight- World Editor Help Zone 6 06-08-2007 02:42 AM
Hot Keys BlazeLancer Map Development 2 08-25-2006 10:34 PM

All times are GMT. The time now is 05:52 PM.






Your link here 
Credit Card | Berlin Property | Mortgage Calculator | Myspace Proxy | Yugioh
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle