View Full Version : Need help Making Multiplayer Map Work
coyan2
08-05-2008, 11:48 AM
Hello, and thank you for this community....
I know Zero Hour is an old game, But I do hope that someone out here still remembers how to make scripts for Worldbuilder, and Zero Hour Maps...
Ok,
I made a 3 player map, and then added in some battleships for players to capture a building to gain control of them. It works on when I play the map just fine. But when My son and his friend get into the game, anytime we try to garrison the building, we get a mismatch error, and the game is over...
I used the Local Player to make the script work for me. But Im guessing there can be only one Local Player, as when the others get in, it goes Kaput..
So, I tried to set up teams, Player_1, Player_2, and Player_3.. Then script in If Local Player is at Starting position 1, then transfer assets of player one to local player, and did the same for position 2, and 3, giving them teams/players 2, and 3 respectively.
If I take out the capture building script, and just have the players capture the carrier, it works with no problems.. Well, the battleships cant be captured.. And I cant seem to be able to get the sidebar buttons to show up either...
Soo, Any help on this would be great...
Thanks..
Coy.
apple23
08-05-2008, 12:22 PM
I used the Local Player to make the script work for me. But Im guessing there can be only one Local Player, as when the others get in, it goes Kaput..
So, I tried to set up teams, Player_1, Player_2, and Player_3.. Then script in If Local Player is at Starting position 1, then transfer assets of player one to local player, and did the same for position 2, and 3, giving them teams/players 2, and 3 respectively.
If I take out the capture building script, and just have the players capture the carrier, it works with no problems.. Well, the battleships cant be captured.. And I cant seem to be able to get the sidebar buttons to show up either...
Soo, Any help on this would be great...
Thanks..
Coy.
First off, I gotta say good job for first trying to work out your problem before coming here. I haven't seen a logical thinker like you post a mapping question here in ages.
So now I want to get this straight, you want to be able to capture a building, and then when the building is captured, transfer the ships in the naval yard to whoever captured the building?
coyan2
08-05-2008, 03:07 PM
Yes....And thank you...
Ok, I will post a few scripts that I made, and the results...
First off
I tried this..
*** IF ***
Player 'player_1' has entered building named Unit 'BattleshipControll'
*** THEN ***
Unit 'Battleship001' is transferred to the command of Player 'player_1'
Unit 'Battleship002' is transferred to the command of Player 'player_1'
Unit 'Battleship003' is transferred to the command of Player 'player_1'
Unit 'Carrier001' is transferred to the command of Player 'player_1'
Using <Local Player> in place of 'player_1'
It worked fine, I got control of the ships, But no sidebar shortcuts. I think I have to do that in a Map.ini, Still working on that..But only if I am the only one that plays, If my son joins the game, then if either of us takes the building, the game gives us a mismatch error, and stops the game.
Now. I created the player, 'player_1' and 2 and 3, but that does nothing, So I tried this..
*** IF ***
Player '<Local Player>' starting position is 1 .
*** THEN ***
Unit 'Battleship001' is transferred to the command of Player '<Local Player>'
Unit 'Battleship002' is transferred to the command of Player '<Local Player>'
Unit 'Battleship003' is transferred to the command of Player '<Local Player>'
and giving the local player the ships strait off, and this will work as long as I play it with only one player... If a second player comes in, it mismatches..Even if I only give them to one player..
Im thinking that I need to get the local player to be given a player slot, But I cant seem to be able to, Im either looking in the wrong spot, or it cant be done...
I do know that with no scripts active, and if the carrier is close enough to land, It can be captured, and used by the capturing player, My son and I had a nice battle over that thing the other nite. He lost.. lol....
Anyway, can this be done on a multiplayer map?
Thanks for the reply..
Coy.
coyan2
08-07-2008, 04:48 PM
Thought I would update this, As I got things to work for me by using the Map.ini...
It took some time, and some digging and looking at scripts that are used in the missions, but I found some help..
Im not using the scripts to do anything but control the flow of money in the supply docks. As to much scripting can break the map and then it becomes a single player, and I am trying to make it multiplayer...
So, What I was able to do is make the battleship captureable, and vulnarable to attack, so it can be destroyed, and the same with the carrier. Now, no matter what side you play, you have the sidebar shortcuts for them both. I was also able to make all the airports un-buildable, and keep things on the ground, Except when you get to a carrier.
Now, All I need id to figure out how to remove items from the science commands lists. I can manipulate most of the other sets, But the ones for science I cant seem to make changes on... Help there would be great...
Thanks again..
Coy
apple23
08-09-2008, 05:25 PM
You went about it the best way that I believe is possible to suit your purpose.
Too much scripting dosen't break a map, the wrong scripting does.
In your first scenario, you got the mismatch in multiplayer because '<local player>' is a singleplayer script-based function the refers to the player that the computer is recieving input from. You got the mismatch because to your comp, you are the local player, and to your other comp, he is the local player. The game detects that the scenarios don't match and ends the game.
And in case you were wondering, there is no way to give an asset to a specific human player.
And to remove the science commands, you have to find thier commandbutton and change one of its flags so it appears only at the command center. I don't know specifically how, however, because I haven't realyl messed with that very much.
If editing the CommandButton dosen't work, look at the Science.ini and see if that does the trick.
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.