(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > World Editor Help Zone

World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README!

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 08-30-2007, 11:16 PM   #1 (permalink)
 
subressor's Avatar

your favorite avatar fan
 
Join Date: Mar 2007
Posts: 156

subressor has little to show at this moment (2)


Exclamation changing players names

hi i am killing myself with this one thing that i can't seem to get right. changing players names (i.e a player types a chat message like -set name *name here*) but i can't figure out how substrings work, and i can't find an unprotected warcraft 3 map that has this feature. plz help!! i have been trying for the past hour!! ty
subressor is offline  
Old 08-31-2007, 08:34 AM   #2 (permalink)
 
-=Emergenzy=-'s Avatar

User
 
Join Date: Jul 2004
Posts: 502

-=Emergenzy=- has little to show at this moment (15)-=Emergenzy=- has little to show at this moment (15)


GUI Trigger:
Player - Player 1 (Red) types a chat message containing -set name as A substring
Player - Player 2 (Blue) types a chat message containing -set name as A substring
Player - Player 3 (Teal) types a chat message containing -set name as A substring
Set s = (Substring((Entered chat string), 11, (Length of (Entered chat string))))
Player - Set name of (Triggering player) to s
Game - Display to (All players) the text: (Name of (Triggering player))

JASS Script:

function Trig_Melee_Initialization_Copy_Actions takes nothing returns nothing
    local string s = SubString(GetEventPlayerChatString(),11-1,StringLength(GetEventPlayerChatString()))
    call SetPlayerName( GetTriggerPlayer(), s )
    call DisplayTextToForce( GetPlayersAll(), GetPlayerName(GetTriggerPlayer()) )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization_Copy takes nothing returns nothing
    set gg_trg_Melee_Initialization_Copy = CreateTrigger( )
    call TriggerRegisterPlayerChatEvent( gg_trg_Melee_Initialization_Copy, Player(0), "-set name ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Melee_Initialization_Copy, Player(1), "-set name ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Melee_Initialization_Copy, Player(2), "-set name ", false )
    call TriggerAddAction( gg_trg_Melee_Initialization_Copy, function Trig_Melee_Initialization_Copy_Actions )
endfunction

Last edited by -=Emergenzy=-; 08-31-2007 at 08:52 AM. Reason: Tags fixed.
-=Emergenzy=- is offline  
Old 08-31-2007, 09:39 PM   #3 (permalink)
 
subressor's Avatar

your favorite avatar fan
 
Join Date: Mar 2007
Posts: 156

subressor has little to show at this moment (2)


ahh tyvm! it works!! (i still don't understand how it works) but tyvm!!
subressor is offline  
Old 09-01-2007, 12:08 AM   #4 (permalink)
 
Karmine's Avatar

Death to all!
 
Join Date: Aug 2007
Posts: 34

Karmine has little to show at this moment (24)Karmine has little to show at this moment (24)Karmine has little to show at this moment (24)


I made a unprotected map of with this trigger going to upload it soon on this site, It's called Askaria... you can steal anything from my maps if you want. Unless it is protected like Sturlungar Final v.
__________________
I am man of many words......
Karmine 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
Changing the amount of players out-game Lon-ami World Editor Help Zone 1 11-02-2007 10:43 AM
Changing Hero Proper names in game PalidinMaster3 Map Development 6 01-07-2005 04:17 AM
Trigger that allows players to change their names? Furkentine Map Development 7 01-03-2005 10:49 AM
Changing Hero Text Names? Moogul The Sly Map Development 2 09-12-2004 07:38 AM

All times are GMT. The time now is 07:18 AM.






Your link here 
Outsource | Buy Shares | Problem Mortgage | Loans | Loans
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle