GodlyGamer
18 years ago
Is it possible to have script working for players during a "Multiplayer" match?
I would like to make a game where each player has a GLA Worker in an area of the map, where you walk towards Civilian Owned units such as "Rangers, RedGuards, Rebels, MissileDefenders, TankHunters, RPGTroopers, etc." and have more Powerful units available to players as they get more kills... In order to do this, I must be able to spawn units for players that do not exist: "Local Player".

Which brings me to my main question: In a multiplayer match, while referring to 'Local Player', how does the game function. If I store the 'Local Players' "Location" to a counter, and there are 2 players, will it:
1) Not be defined.
2) Be defined as the last player to have ran the script.
3) Or be defined to the individual player as the location he belongs to?

Finally: When spawning a unit for "Local Player" the game crashes... so is what I wish to do at all possible?
Sponsor
U-W-SAtomicarmy
18 years ago
Some Scripts will work online but a lot of them won't. Is it ok if you put the map on the forum so I can see what is wrong with the scripting?
Don't look at the light!!!
GodlyGamer
18 years ago
There isn't anything "wrong" with my script, all the script I have written for what I need done works... it is the script I don't know how to do which I can't do, so there isn't anything to show what I've done wrong.

I need to know how to spawn a unit for the "Local Player" (This doesn't seem possible because the only unit spawning must be assigned to a team, not a player)
Me Myself and Pi
18 years ago
refers to the human player playing. If there is more then one human playing, a mismatch will occur. (Don't ask me why.) It's better to use instead. Keep the script you are using it in in the PlyrCivilian folder. This will still refer to the host of the game, except a mismatch won't occur. Unfortunately, there is not other players that will refer to the other players in a multiplayer game. 😞

I've also had trouble with the game crashing when a unit spawns. Try spawning the same unit on a blank test map. If it works, then there may be no way for it to work on your map. I have no idea why though. When I was working on an AOD map awhile back, I tried to have UN crates spawn at regular time intervals, but the game would crash. Though on another map, it worked fine! I recommend you place the units on the map, then transfer them to the host instead of spawning them. If you want the units to appear at a certain time, try spawning the unit on PlyrCivilian, then transfer them to
U-W-SAtomicarmy
18 years ago
Sorry, I thought something was wrong with your scripts, I get confused real easy. A question about dams, will they cause a mismatch because when I play online with a dam on the map, it has a mismatch, I played another map with a dam that I did not make and it did not have a mismatch.

Don't look at the light!!!
kaindryson
18 years ago
I also have a simular question...
For a multiplayer map (2 human players only) I need to know how to have a pre-placed civilian owned unit join what ever player gets close to it...


My example: Both human players are GLA, each have a civilian owned USA and China Dozer close to their base. I want the dozers to join the player that gets a unit close to it...

Is this possible?
If so, what exacly do I do to accomplish this?

I guess I'm not quite understanding completely how to do scripts :P
I have found out how to disable sertant buildings and science techs from being built FYI :)
so I'm not totally lost

BTW I dont have Zero Hour expansion

Thank you very much in advance... E-mail me if needed...
-Kain Dryson-
Me Myself and Pi
18 years ago
Well, it's not possible to do exactly what you want. But what you can do is just make the dozers "unmanned". (When Jarmen Kell snipes a vehicle, he puts in an unmanned state.) This way, the player can just just garrison an infantry unit inside & it will belong to that player. If you know script well enough, then just create a script with the action, Unit\Status\Make unmanned. If that doesn't make sence to you then follow these steps:

1) Name each of the dozers a distinguished name.
2) Open up the scripts window. (Edit->Script... or you can select in on the tool bar.)
3) Select the PlyrCivilian folder (The PlyrCivilian folder is set aside for scripts in a multiplayer map. If you put a script any of the other folders, the AI scripts will be disabled for this map. In other words, the skirmish players won't work.)
4) Create a new script there (click on the New button) & name it whatever you want. Leave everything everything else in the Script Properties tab.
5) Click on the Actions if True tab & while the null action is selected, click the Edit button.
6) You may have to scroll down to see it, click on the plus sign infront of the + Unit, then the + Status, & finally Make Unmanned. Another way to say it is use the following action: "Unit\Status\Make unmanned."
7) In the area below where you see "Make Unit '???' unmanned.". Click on the "Unit '???'" link & select the first unit you named.
8) Click OK & copy that action choose the other unit. (Click Copy, then Edit, "Unit '???'", & finally the second unit you named.
9) Close the 3 windows by clicking on OK. That should do it!

Let me know if anything didn't make sence.
kaindryson
18 years ago
when I click on edit on the action if true tab, all I get is a drop down box and a list of all the scripting possiblities.. I see nothing with [Unit] Status Make Unmanned.. is it possible that it says something different sence I dont have Zero Hour expansion?

http://www.cncden.com/worldbuilder/teams/params.jpg 
and I see nothing like [Unit] Make Unmanned or anything like that, the only things that I see with the word Unmanned is "[Scripting] Delete all unmanned (sniped) vehicles"...

Also the map is not set up for AI just 2 player human vs human.

Would there be a way to make both players start out with more units than just 1 Worker?
-Kain Dryson-
Me Myself and Pi
18 years ago
Oh, well you didn't say that you were using just Generals. I usually assume that members are using Zero Hour when they don't specify one way or the other.

http://www.cncgeneralsworld.com/forums/topic.asp?ARCHIVE=true&TOPIC_ID=8214 
But it might be easier if you just add some command buttons to allow the players to build the workers/dozers. You can use the following actions:

[Scripting] Add a commandbutton to an object type.
[Map] Adjust the tech tree for a specific object type.

The script should look like this:

*** IF ***
    True.
*** THEN ***
  [???] Command button: 'Command_ConstructChinaDozer' is added to all objects of type 'AmericaCommandCenter' in slot number  2  (1-12).
  [???] Command button: 'Command_ConstructGLAWorker' is added to all objects of type 'AmericaCommandCenter' in slot number  3  (1-12).
  [???] Command button: 'Command_ConstructAmericaDozer' is added to all objects of type 'ChinaCommandCenter' in slot number  2  (1-12).
  [???] Command button: 'Command_ConstructGLAWorker' is added to all objects of type 'ChinaCommandCenter' in slot number  3  (1-12).
  [???] Command button: 'Command_ConstructAmericaDozer' is added to all objects of type 'GLACommandCenter' in slot number  2  (1-12).
  [???] Command button: 'Command_ConstructChinaDozer' is added to all objects of type 'GLACommandCenter' in slot number  3  (1-12).
  'AmericaVehicleDozer' becomes Buildable (Ignore_Prerequisites)
  'ChinaVehicleDozer' becomes Buildable (Ignore_Prerequisites)
  'GLAInfantryWorker' becomes Buildable (Ignore_Prerequisites)
When using the action to add command buttons, you should see a vertical charter, "|", at the end of every command button name. Delete it, otherwise the action won't work. (This is a bug. 👎) If you don't see one, it's there none the less. Select the end of command button name, then press backspace. It should seem like nothing is deleted, but that character does get deleted. Once you've deleted the character, those 3 question marks will come up, just ignore them.

The action to ignore the prerequisites is necessary. If you don't include those actions & play the game, you won't be able to build the units. In the description window, you'll see that the unit requires that you own its corresponding command center. Ignoring the prerequisites allows you to build it anyway.
kaindryson
18 years ago
Thanks for the help. that worked out great...
-Kain Dryson-
Sky Demon
18 years ago
Hey as you mentioned about adding units into slots...
I have always had trouble with adding units to certain buildings. I add in all the necessary sripting but it never worked. Now I know it was probably that wierd ¦ bug thing. I will remember that! But the Slots have always puzzled me. The Command centers are easy as there is only 2-3 build items buildable.

But with other structures like Airfield it is more complex. Are the Slot numbers setup left to rigth like
123456
789101112

or

1357911
24681012

????

This is a big problem for me as even if my Scripting works the Prerequisite added to the structure might be canceled out or overwriting something else I don't want it to...
Me Myself and Pi
18 years ago
The command button slots are labeled like this:

🅱+----+----+----+----+----+----+----+
| 🅱1[/b]  | 🅱3[/b]  | 🅱5[/b]  | 🅱7[/b]  | 🅱9[/b]  | 🅱11[/b] | 🅱13[/b] |
+----+----+----+----+----+----+----+
| 🅱2[/b]  | 🅱4[/b]  | 🅱6[/b]  | 🅱8[/b]  | 🅱10[/b] | 🅱12[/b] | 🅱14[/b] |
+----+----+----+----+----+----+----+[/b]
This is the same for all the structures & units.