wc3edit.net

United Warcraft 3 map hacking!
It is currently April 24th, 2024, 11:05 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: October 29th, 2012, 7:02 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1999
Location: Calgary Canada
Title: No Comment
I was wondering if it was possible that instead of a builder/race having the same towers, it could be coded that the builder would receive all of his towers randomly when the game starts up.

So if there were basic, normal and advanced towers:

A B C D E (Basic)
F G H I J (Normal)
K L M N O (Advanced)


He could get something like this as his "structures built":

B D E
F I J
K M O


And maybe next game he gets this:

A B E
G H I
L N O

BTW, I use GUI, so pleeeeze don't spit out any jass crap to me or I will be so cunfused that I will have to post a pic of a dog tilting its head. :lol:

_________________
.
.
How to use cheats: http://forum.wc3edit.net/announces/are- ... 35804.html


Top
 Profile  
 
PostPosted: October 30th, 2012, 12:56 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
The key here is the trigger "Player - Set Training/Construction Availability Of Unit.". What your gonna have to do is add each tower to a unit, then at the start of the game disable each of the towers.
Code:
Player Group - Pick every player in (All players) and do (Actions)
    Loop - Actions
        Player - Make Town Hall Unavailable for training/construction by (Picked player)
        Player - Make Farm Unavailable for training/construction by (Picked player)
        Player - Make Altar of Kings Unavailable for training/construction by (Picked player)
        ...

Then create some type of trigger to get random numbers.
Code:
For each (Integer A) from 1 to 10, do (Actions)
    Loop - Actions
        Set TowersRed[(Integer A)] = (Random integer number between 1 and 10)
        Set TowersBlue[(Interger A)] = (Random integer number between 1 and 10)
        ...

Then the code to check and add the towers, one will need to be done for each player.
Code:
For each (Integer A) from 1 to 10, do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TowersRed[(Integer A)] Equal to 1
            Then - Actions
                Player - Make Town Hall Available for training/construction by Player 1 (Red)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TowersRed[(Integer A)] Equal to 2
                    Then - Actions
                        Player - Make Keep Available for training/construction by Player 1 (Red)
                    Else - Actions

Now, this is just the base, and there is a serious problem with it that needs to be fixed if you want to use this method. The random number does not check if there are duplicates..so it may come out to something like 1,4,2,1,1..which will result in only 3 towers instead of the intended 5. At this time i have no idea how it would be fixed..so you may have to brainstorm on that for a bit, otherwise just create a different type of trigger to check.

Anyways, i tested it out and was able to get different towers for each time. So i believe this is a good place to start.

Edit..oh..shit. I just realized the title said 200 towers..err..sorry i couldn't make it any easier but this was the only way i found that could do something like this.

_________________
Image


Top
 Profile  
 
PostPosted: October 30th, 2012, 6:06 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1999
Location: Calgary Canada
Title: No Comment
Hey good start. I think I see a problem though.

Code:
Player Group - Pick every player in (All players) and do (Actions)



This will disable the towers for EVERY race. Don't forget, I still need to be able to use the other races still.


Using this method, I am wondering if it would be easiest to add 200 towers to the builder, and then a trigger to randomly disable 190 towers. But I wonder if a builder can actually have 200 towers.

EDIT: Well I think I may have to get rid of this windows 8 crap and go back to using win7. My damn WC crashes every time I want to test any triggers. Even with older untouched versions.

_________________
.
.
How to use cheats: http://forum.wc3edit.net/announces/are- ... 35804.html


Top
 Profile  
 
PostPosted: October 31st, 2012, 3:32 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Vegas wrote:
This will disable the towers for EVERY race. Don't forget, I still need to be able to use the other races still.


Using this method, I am wondering if it would be easiest to add 200 towers to the builder, and then a trigger to randomly disable 190 towers. But I wonder if a builder can actually have 200 towers.
Yeah, i wasn't sure how your game played so i put it for all players but that is easily changed. About the unit having 200 buildings, as a test i added multiple units to the peasant, i was able to add over 200 units and it did not crash in-game when i opened the build menu for him.

So..about just disabling them, when i was testing with all the towers available and disabling them i realized that it goes by the units build order, the way you added the towers to the builder. Basically..if a number gets selected twice, one or more of the first 11 towers will always be shown... as you imagine this is a problem. So, using this method we are basically stuck until a way past this is made.

If we disable all towers then randomly enable them, if the number is picked twice there will be less than 11 towers available. And if they are enabled and randomly disabled one of the first 11 towers will always be shown. We have to find either a way to add the towers that does not rely so much on the random trigger, or see if there is a way to check to see individual integers to see if its duplicated.

I've been working out a way, which should work but its a bit of extra work..basically you got two triggers, well, three but the third can be done without much effort....First is setting each tower to a unit-type variable. Then, making an action which makes a integer variable random numbers for each player.
Code:
Untitled Trigger 004 Copy
    Events
        Map initialization
    Conditions
    Actions
        Set Towers[1] = Town Hall
        Set Towers[2] = Keep
        Set Towers[3] = Castle
        Set Towers[4] = Barracks
        ...
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set TowersIntRed[(Integer A)] = (Random integer number between 1 and 200)
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set TowersIntBlue[(Integer A)] = (Random integer number between 1 and 200)
        ...


Then, for the second trigger, this one will get pretty big. Basically we have a set timer for .30 seconds, which is used to check if there are any duplicates, and we just use conditions to go one by one and add them in. But..you would have to copy and create one if/then/else for each other player. I just used red here, blue would go under..and so on.
Code:
Untitled Trigger 005
    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
                Or - Any (Conditions) are true
                    Conditions
                        TowersIntRed[1] Equal to TowersIntRed[2]
                        TowersIntRed[1] Equal to TowersIntRed[3]
                        TowersIntRed[1] Equal to TowersIntRed[4]
                        ...
            Then - Actions
                Set TowersIntRed[1] = (Random integer number between 1 and 200)
                Player - Make Towers[TowersIntRed[1]] Available for training/construction by Player 1 (Red)
            Else - Actions
                Player - Make Towers[TowersIntRed[1]] Available for training/construction by Player 1 (Red)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        TowersIntRed[2] Equal to TowersIntRed[3]
                        TowersIntRed[2] Equal to TowersIntRed[4]
                        TowersIntRed[2] Equal to TowersIntRed[5]
                        ...
            Then - Actions
                Set TowersIntRed[2] = (Random integer number between 1 and 200)
                Player - Make Towers[TowersIntRed[2]] Available for training/construction by Player 1 (Red)
            Else - Actions
                Player - Make Towers[TowersIntRed[2]] Available for training/construction by Player 1 (Red)
Its a bit of time spent, but i do not see any reason why this should not work.
The final trigger is simply one to turn off the last trigger.
Code:
Untitled Trigger 006
    Events
        Time - Elapsed game time is 3.00 seconds
    Conditions
    Actions
        Trigger - Turn off Untitled Trigger 005 <gen>

Hopefully you can see through the mess ive made and get it working right. Towers is a unit-type variable, array size 200 for each tower. TowerInt is integer variable, array size 11.

Edit : Forgot to add, in the trigger that adds the towers to the interger you will need to disable the towers for this one to work since we are enableing them. With the towers being added to the integer this can easily be done by adding the action
Code:
Player Group - Pick every player in (All players) and do (For each (Integer A) from 1 to 200, do (Player - Make Towers[(Integer A)] Unavailable for training/construction by (Picked player)))


Edit2 : Found a few copy/paste errors in the code.

_________________
Image


Last edited by Syre on November 1st, 2012, 7:17 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: October 31st, 2012, 6:49 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1999
Location: Calgary Canada
Title: No Comment
Cool. Thanks for your input again. I will see if I can try it this afternoon, but if you noticed another post of mine, I am having problems with saving in WEU. Have to try and fix this problem first, otherwise I cant do anything!!

_________________
.
.
How to use cheats: http://forum.wc3edit.net/announces/are- ... 35804.html


Top
 Profile  
 
PostPosted: November 4th, 2012, 1:18 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1999
Location: Calgary Canada
Title: No Comment
Hahaha, I finally got my WEU figured out. So I still am trying to work out these triggers and nothing is working yet. Still curious about this one

Code:
Player Group - Pick every player in (All players) and do (For each (Integer A) from 1 to 200, do (Player - Make Towers[(Integer A)] Unavailable for training/construction by (Picked player)))


Won't this turn off the towers for all the other players?

Also do I really need "TowersIntRed[1] " and "TowersIntBlue[1]" ??
The trigger should be activated by player, whichever color he may be. Remember it could be that 10 players are other races, and player 6 wants to be this race.


BTW, I'm not complaining, just trying to figure this out still. I do appreciate your help, especially since I'm re-learning WE again after so long away. :lol: :lol:

_________________
.
.
How to use cheats: http://forum.wc3edit.net/announces/are- ... 35804.html


Top
 Profile  
 
PostPosted: November 4th, 2012, 3:57 pm 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Ah, alright i understand a bit better now. Since im not editing the map myself i dont know how you wanted this to be done. I was under the impression that you were making it so every builder had random towers, not just one, hence i put it for all players. So..try something like this instead.

Trigger 1
Code:
Untitled Trigger 004 Copy
    Events
        Map initialization
    Conditions
    Actions
        Set Towers[1] = Town Hall
        Set Towers[2] = Keep
        Set Towers[3] = Castle
        Set Towers[4] = Barracks
        ...


Trigger 2
Code:
Untitled Trigger 008
    Events
        Unit - A unit Finishes training a unit
    Conditions
        (Unit-type of (Trained unit)) Equal to Builder
    Actions
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set TowersInt[(Integer A)] = (Random integer number between 1 and 200)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        TowersInt[1] Equal to TowersInt[2]
                        TowersInt[1] Equal to TowersInt[3]
                        TowersInt[1] Equal to TowersInt[4]
                        ...
            Then - Actions
                Set TowersInt[1] = (Random integer number between 1 and 200)
                Player - Make Towers[TowersInt[1]] Available for training/construction by (Owner of (Trained unit))
            Else - Actions
                Player - Make Towers[TowersInt[1]] Available for training/construction by (Owner of (Trained unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        TowersInt[2] Equal to TowersInt[3]
                        TowersInt[2] Equal to TowersInt[4]
                        TowersInt[2] Equal to TowersInt[5]
                        ...
            Then - Actions
                Set TowersInt[2] = (Random integer number between 1 and 200)
                Player - Make Towers[TowersInt[2]] Available for training/construction by (Owner of (Trained unit))
            Else - Actions
                Player - Make Towers[TowersInt[2]] Available for training/construction by (Owner of (Trained unit))
        ...


Its..basically the same triggers except less work. In the first trigger ive removed the loop and put it inside trigger two, so that a random integer is set each time a builder is picked. Trigger 2 is pretty much the same except i removed the timer and instead it works when the builder is chosen. Also you don't have to have towersint for each player. Since it changes the way each time a builder is picked its no longer needed.

However, since ive simplified this by removing the checks for each player, it only checks once. The odds are very poor since it does do a check, but its still possible for a number to be chosen twice.

_________________
Image


Top
 Profile  
 
PostPosted: November 4th, 2012, 4:05 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1999
Location: Calgary Canada
Title: No Comment
Cool, thanks. I am just doing my paperwork for the month of October, but hopefully can look at it in-depth in about an hour.


just wondering how did you come up with this:

Player - Make Towers[TowersInt[1]] Available for training/construction by (Owner of (Trained unit))

I can only get this:
Player - Make A_tower[1] Available for training/construction by (Owner of (Trained unit))

Maybe I have my variables wrong.

A_towersint is an interger array size 11 intiail size is 1
A_towers is Unit-type unicode array size 11 initial is no-unit

_________________
.
.
How to use cheats: http://forum.wc3edit.net/announces/are- ... 35804.html


Top
 Profile  
 
PostPosted: November 4th, 2012, 8:29 pm 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Click the little [1] next to a_towers. Then at the top, select the integer variable a_towerint. Then click index, and change that option for the check. Also..sorry to bring bad news but a_towers has to be an array size of 200...Its for each tower that you have. You have to set it one by one in the first trigger.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)