HOST

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

hermit17
Junior Member
Posts: 43
Joined: November 30th, 2008, 2:28 am

HOST

Post by hermit17 »

WHen i set a custom script gethost() and it works, how do i make the Variable host to kick the player instead of player red
User avatar
Vegas
Shopping Maul USA Creator
Posts: 1759
Joined: January 18th, 2007, 11:07 am
Title: No Comment
Location: Calgary Canada
Has thanked: 45 times
Been thanked: 8 times

Re: HOST

Post by Vegas »

Slap this in your "custom script" area

Code: Select all

function GetHost takes nothing returns nothing 
local gamecache g = InitGameCache("Map.w3v") 
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1) 
call TriggerSyncStart () 
call SyncStoredInteger ( g, "Map", "Host" ) 
call TriggerSyncReady () 
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1) 
call FlushGameCache( g ) 
set g = null 


endfunction
Put this trigger somewhere a few seconds after map initialization:

Code: Select all

Unit - Change ownership of Tower <gen> to Host and Change color


Code: Select all

Kick Red
    Events
        Player - (Owner of tower <gen>) types a chat message containing -kick red as An exact match
    Conditions
        (Triggering player) Equal to Host
    Actions
        Game - Defeat Player 1 (Red) with the message: You have been kicke...
        Game - Display to (All players) the text: ((Name of Player 1 (Red)) + |cffcc0000 has been kicked.|r)
you have to make a trigger for every color.
Tobias
Senior Member
Posts: 108
Joined: March 18th, 2008, 3:42 pm
Title: Map Maker
Location: Canadadadada

Re: HOST

Post by Tobias »

Tobias's trigger in his map :).
Spoiler:

Code: Select all

Kick
    Events
        Player - Player 1 (Red) types a chat message containing -kick as A substring
        Player - Player 2 (Blue) types a chat message containing -kick as A substring
        Player - Player 3 (Teal) types a chat message containing -kick as A substring
        Player - Player 4 (Purple) types a chat message containing -kick as A substring
        Player - Player 5 (Yellow) types a chat message containing -kick as A substring
        Player - Player 6 (Orange) types a chat message containing -kick as A substring
        Player - Player 7 (Green) types a chat message containing -kick as A substring
        Player - Player 8 (Pink) types a chat message containing -kick as A substring
        Player - Player 9 (Gray) types a chat message containing -kick as A substring
        Player - Player 10 (Light Blue) types a chat message containing -kick as A substring
    Conditions
        (Substring((Entered chat string), 1, 5)) Equal to -kick
        (Triggering player) Equal to Host
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to blue
            Then - Actions
                Game - Defeat Player 2 (Blue) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to teal
            Then - Actions
                Game - Defeat Player 3 (Teal) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to purple
            Then - Actions
                Game - Defeat Player 4 (Purple) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to yellow
            Then - Actions
                Game - Defeat Player 5 (Yellow) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to orange
            Then - Actions
                Game - Defeat Player 6 (Orange) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to green
            Then - Actions
                Game - Defeat Player 7 (Green) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to pink
            Then - Actions
                Game - Defeat Player 8 (Pink) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to gray
            Then - Actions
                Game - Defeat Player 9 (Gray) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to grey
            Then - Actions
                Game - Defeat Player 9 (Gray) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to light blue
            Then - Actions
                Game - Defeat Player 10 (Light Blue) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to lb
            Then - Actions
                Game - Defeat Player 10 (Light Blue) with the message: (You've Been Booted...
            Else - Actions
hermit17
Junior Member
Posts: 43
Joined: November 30th, 2008, 2:28 am

Re: HOST

Post by hermit17 »

where is tower<gen>
pls reply quickly vegas
EDIT: WAT IS TOWER GEN
hermit17
Junior Member
Posts: 43
Joined: November 30th, 2008, 2:28 am

Re: HOST

Post by hermit17 »

bump
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: HOST

Post by Syre »

Vegas is away for the holidays. Anyways i think that Tower <gen> Is a unit he made to place down as a place mat for the trigger. Just make a new unit. Make it a building..probably just a scout tower. Remove the placement it has, and the model file. Give it the ability "Locust" and name it Tower, or whatever you wish and place it somewhere in your map off to the side.

Then for the trigger make it something like this..

Code: Select all

Untitled Trigger 002
    Events
        Time - Elapsed game time is 0.30 seconds
    Conditions
    Actions
        Unit - Change ownership of Unit to Player 1 (Red) and Change color
For unit, click "Select a Unit" and click on your unit that you just made..

Note : Player 1 (Red) is just for example use. That should be changed to the Variable "Host" as he has it.

PS : You can combine Vegas's triggers with Tobias's so you dont have to make an trigger for each player to kick them. Just make Vegas's Script, then the Tower, and then Tobias's trigger, but to work with Vegas's, just a few modifications.

Code: Select all

Events
    Player - (Owner of Tower <gen>) types a chat message containing -kick as A substring
Conditions
        (Substring((Entered chat string), 1, 5)) Equal to -kick
        (Triggering player) Equal to Host
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to blue
            Then - Actions
                Game - Defeat Player 2 (Blue) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to teal
            Then - Actions
                Game - Defeat Player 3 (Teal) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to purple
            Then - Actions
                Game - Defeat Player 4 (Purple) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to yellow
            Then - Actions
                Game - Defeat Player 5 (Yellow) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to orange
            Then - Actions
                Game - Defeat Player 6 (Orange) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to green
            Then - Actions
                Game - Defeat Player 7 (Green) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to pink
            Then - Actions
                Game - Defeat Player 8 (Pink) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to gray
            Then - Actions
                Game - Defeat Player 9 (Gray) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to grey
            Then - Actions
                Game - Defeat Player 9 (Gray) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to light blue
            Then - Actions
                Game - Defeat Player 10 (Light Blue) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to lb
            Then - Actions
                Game - Defeat Player 10 (Light Blue) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to dg
            Then - Actions
                Game - Defeat Player 11 (Dark Green) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to dark green
            Then - Actions
                Game - Defeat Player 11 (Dark Green) with the message: (You've Been Booted...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to brown
            Then - Actions
                Game - Defeat Player 12 (Brown) with the message: (You've Been Booted...
            Else - Actions

Something like this perhaps? ;x
Image
hermit17
Junior Member
Posts: 43
Joined: November 30th, 2008, 2:28 am

Re: HOST

Post by hermit17 »

i tried tobias trigger but it failed bad
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: HOST

Post by Syre »

It may just be because of some missing parts with his trigger...at least in the code shown..try something like this..

Code: Select all

Untitled Trigger 002
    Events
        Player - (Owner of Tower <gen>) types a chat message containing -kick as A substring
    Conditions
        (Substring((Entered chat string), 1, 5)) Equal to -kick
        (Triggering Player) Equal to Host
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 7, 20)) Equal to blue
            Then - Actions
                Game - Defeat Player 2 (Blue) with the message: Defeat!
            Else - Actions
                Do nothing
Of course, you will have to copy the action for every other player..but i just tested it and it seems to work..
Image
hermit17
Junior Member
Posts: 43
Joined: November 30th, 2008, 2:28 am

Re: HOST

Post by hermit17 »

i dun understand
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: HOST

Post by Syre »

Lol..alright ill break it down for you then. Starting with the Event..
Spoiler:
Player - Chat Message...Player 1 (Red) types a chat message containing Text as A exact match.
Starting with Player 1, change that to "Owner of Unit" Then for unit, click "Select a Unit" and click the Tower, that you should have placed down. That should change it to (Owner of Tower <gen>) types a chat message containing Text as A exact match. Change the text to -kick, and change exact match to A substring
Thats it for the event. Now for the condition.
Spoiler:
First one is "String Comparison". Then it should come out to be (Entered chat string) equal to Value. Then starting with Entered chat string, change that to "Substring" which is the second or third from the top. That should now show Substring(String, 1, 5). Click "String" then go to "Event Response - Entered Chat String". Then your condition should look like (Substring((Entered Chat String), 1, 5) Equal to Value. Change Value to -kick. And your first condition is done.

Then make another condition. This ones easy. Make it "Player Comparison" then it should show (Owner of((Triggering Unit)) Equal to Player 1 (Red). Change the "Owner of Triggering Unit" to "Event Response - Triggering Player". Then change "Player 1" to the Variable "Host" which should have been made previously. That should be your second condition.
Now your actions.
Spoiler:
Create a new action and make it "If / Then / Else, Multiple Functions". Alright, for the "If - Condtions" Create one, it should be made the same way your Substring Condition was, but instead of saying "-kick" it should be changed to the color you want. For this one we want blue. Also change the numbers to 7, 20. *Im pretty much a noob with this stuff so i dont know what that does..hopefully someone will explain..i just followed Tobias's example* Anyways...that should come out to be (Substring((Entered chat string), 7, 20)) Equal to blue. If thats what you have then your done with your Conditon..if not then re-read the steps that i listed above for the condition.

Now, for "Then - Actions" Create a new one..quite simple just go down to Game - Defeat. Then change the player to be kicked accordingly, along with whatever message you want..

Then the last, just have it as Do Nothing. And you should be done...
Now to make it for every player. Just copy the Actions and change the colors to work with each player along with the text. For Dark Green and Light Blue, Make two of them, One should say dark green, the other dg..the same goes for light blue. It just simplifies it since some dont prefer to type it all out.

If you still dont get what it is..post your problem down..cause im pretty sure i explained it as simple as possible...
Image