• 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.

Quick Command

Status
Not open for further replies.
Level 9
Joined
Aug 11, 2007
Messages
429
How can i make it so when player red types "-rain light" its starts to rain on the map.

im pretty sure i know, just want to be sure.

someone help soon please, i want to get this done, thanks.
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Well you trigger it when a player enters a string. The player is player red and the string is "-rain light" as an exact match.

You then preform your weather changing actions but to do so you may need to remove all current weather to stop wierd overlaping problems I think WC3 suffers from. This is the simplest system for such a trigger, ofcourse it can get more complicated with substrings and stuff but that is not what you asked for.

Please only ask if it really is needed (you honestly can not do it or it is giving problems ect.) as otherwise you may find out that what you thought really did work and so you ended up wasting peoples time.

P.S. Please read the site rules, as I am sure we have something about double posting (posting in under 48 hours from last post) and not doing it.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Yea i tried what i said, but it didnt work, coudl you make it in one of those trigger formats that i can look at. thanks.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Ok first the recomended JASS version.
JASS:
function Trig_Weather_Actions takes nothing returns nothing
    call RemoveWeatherEffect(udg_WE)
    set udg_WE = AddWeatherEffect(GetWorldBounds(),'RAlr')
    call EnableWeatherEffect(udg_WE,true)
endfunction

function InitTrig_Weather takes nothing returns nothing
    set gg_trg_Weather = CreateTrigger()
    call TriggerRegisterPlayerChatEvent(gg_trg_Weather, Player(0),"-rain light",true)
    call TriggerAddAction(gg_trg_Weather,function Trig_Weather_Actions)
endfunction

This is for a trigger called "Weather" and as you notice uses a global "Weather Effect" type variable called WE.

For you people who do not like JASS although it is infinatly superior to GUI.
  • Weather
    • Events
      • Player - Player 1 (Red) types a chat message containing -rain light as An exact match
    • Conditions
    • Actions
      • Environment - Remove WE
      • Environment - Create at (Entire map) the weather effect Ashenvale Rain (Light)
      • Set WE = (Last created weather effect)
      • Environment - Turn WE On
This GUI trigger uses the same global as the JASS one and as it is GUI trigger name does not mater.

I have tried and tested the GUI one and it does work ingame, the JASS one will most definatly also work as it is a exact copy and enhance from the GUI.
 
Status
Not open for further replies.
Top