Posted by: berkbria - Saturday, November 10, 2007 6:51:23 PM
I have a nice map with full scripting added and a complex waypoint system but it is a bassic skirmish map (kill everyone else and win), I want to make the objective to be for one team to capture 4 specific buildings to win the game. Instead of killing everyone to win. how can I do this to my map. in the scripting?

Posted by: fleetatks - Saturday, November 10, 2007 7:08:08 PM
Use scripting to do something along the lines of *If "Unit_ is captured by player_ *AND Unit_ is captured by player_ *AND Ect.." *Then (Either use "Player->ShowVictorious and end game" or activate another script so you can do custom things such as play music and show text before ending game.) There is a USA mission where you have to capture about 5 rockets from GLA, So you can see what script they chose for the capture part. You can also use '*If unit_ Captured *Then add 1 to counter_' in one script, and in another have '*If counter_ = 4 *Then (Either use "Player->ShowVictorious and end game" or activate another script so you can do custom things such as play music and show text before ending game.)

Posted by: berkbria - Saturday, November 10, 2007 7:48:39 PM
If I had 2 players on one team would they both win if either team captures them all? or would it be single player only?

Posted by: berkbria - Saturday, November 10, 2007 7:51:56 PM
on the usa 5 camp. map there is a script folder called Toxin_GLA in there is is a folder for the missle silo's and a entry for each one 1-4, each one adds to the counter but I cant find where the script is that the If counter=4 then end game is at. also it has the human player as player0001 as the ones that need capture but i have no script for a player0001 obviously, I have the scripting that is in the game directory. Do i need to make a new script folder for the human players? or would it just be player_1 and Player_2 to capture because the human players start in start spot 1-2

Posted by: Me Myself and Pi - Sunday, November 11, 2007 7:22:16 AM
Working with scripts for multiplayers is rather limited. You can only refer to the host of the game in a script that calls for a player. To do this, use & make sure the script is in the PlyrCivilian folder. You cannot anouce a win for a player & accounce a loss for another player in the same map, it just doesn't work.

Posted by: berkbria - Sunday, November 11, 2007 2:48:10 PM
I want both the human teams to win when the buildings are captured

Posted by: Me Myself and Pi - Sunday, November 11, 2007 3:24:25 PM
If you want the victory window to come up (which will come up for all the players & only for all the players) once the buildings are captured, then the scripts could look like one of these examples: (The action loction will be next to the respective actions below.)(Lets say you used the BikonurGroundControlCenter) Example 1: [quote]*** IF *** Player 'PlyrCivilian' has Equal To 0 unit or structure of type 'BaikonurGroundControlCenter' (Player\Owns\Player has (comparison) unit type.) *** THEN *** Show 'Victorious' window and end game (Multiplayer\Announce victory.) [/quote] Example 2: [quote]*** IF *** Player '' has Equal To 5 unit or structure of type 'BaikonurGroundControlCenter' (Player\Owns\Player has (comparison) unit type.) *** THEN *** Show 'Victorious' window and end game (Multiplayer\Announce victory.) [/quote][/quote] These are basicly your only options. You can either have so that if any of the buildings be captured, to open the victory window. (Example 1) Or you can it, when the host captures the 5 buildings, the victory window will come up. (Example 2) As I said, scripting this kind of stuff is limited in multiplayer.

Posted by: berkbria - Monday, November 12, 2007 5:14:10 AM
I am having a problem with the first method, I have it set to if Player 'PlyrCivilian' has Equal To 0 units or structure of type 'BaikonurGroundControlCenter' the owners of the buildings are set to TeamPlyrCivilian on the map and as soon as i start the game I win.

Posted by: Me Myself and Pi - Monday, November 12, 2007 6:01:05 AM
I just tried it so I know it works. Could you upload the map please? Oh, one more thing, using this scripting will allow the win to accour even if any of the players capture the buildings.

Posted by: berkbria - Monday, November 12, 2007 6:51:19 AM
I really dont want to send the map to anyone untill it is done could you send one with it working?

Posted by: Me Myself and Pi - Monday, November 12, 2007 1:52:28 PM
Well, I could. But I would need to know what buildings your using. But could you at least send me the script your using so that I can check out what you're doing wrong? To do it, select the script & click on "Export" & save the file. Now, go to the place where you saved the file & put into a ZIP folder & then upload it into a reply. (Let me know if you don't know how to create a ZIP folder.)

Posted by: berkbria - Monday, November 12, 2007 4:39:02 PM
its in, plrycivilian/Shield Gen Win [b]Download Attachment:[/b] [url=http://www.cncgeneralsworld.com/public/files/berkbria/capturewin.zip][img]http://www.cncgeneralsworld.com/forums/images/icon_paperclip.gif[/img] capturewin.zip[/url] 215.84 KB What are the building owners set to on the map you've done it to? [EDIT: Double Post Splice -- CommieDog]

Posted by: Me Myself and Pi - Wednesday, November 14, 2007 6:04:51 AM
Well, you made the script right. The problem might be in your map. Are you sure you have at least one BikonurGroundControlCenter belonging to the PlyrCivilian team? If you sure about this, I really can't help you unless I see you map.

Posted by: berkbria - Wednesday, November 14, 2007 7:51:36 AM
Ive been workin on this a long time I really don't want to send it out just for someone else to add the finishing touches and give it out as there own. I'm sure thats all set right anyway's I think it's something with the scripts in the skirm. players, if you could send me one with full skirm. scripting and that added in that would be all I need, if not i'll just use the second method you suggested that seems to work fine, thanks for all your help.

Posted by: Me Myself and Pi - Thursday, November 15, 2007 3:04:07 PM
I could send you some working scripts, but I have a question first. When I imported your scripts, (I noticed you have the skirmish included. How come?) They weren't imported into the corrective folders. This happens when you import the originaly skirmish scripts for the first time. But the script you made was also not in the correct folder. So it wasn't in the PlyrCivilian, it was in another skirmish folder. Was it like this on your computer?

Posted by: berkbria - Thursday, November 15, 2007 5:47:09 PM
I fixed it! finally, i guess there was something wrong in the civilian scripting, i just copied the map removed all the scripting then removed the civilian scprting from the old scripts and imported the rest to the copied map and added the civs. scripts back in maunally, now it works, thanks though you've been a ton of help, I had no idea how any of this crap worked b4 I came here. no it is not like that on mine, that has been corrected on mine, when we originally imported the full scripting though it was like that for some reason with the wrong teams in the wrong folders, you have to remove everything, put all new folders in, that are in the order it places them then import. I guess the order it put the teams on basic scripting (add skirimish player's) is diffrent from the order they are in with the full scripting. i guess its wrong on yours cos it's been changed around a bit from when we fixed it, and it doesnt import the folders.

Posted by: Me Myself and Pi - Friday, November 16, 2007 6:11:51 AM
Yay! I'm glad you got it working. But I've rearranged the skirmish script so they do import into the correct folders. Just download them below. [b]Download Attachment:[/b] [url=http://www.cncgeneralsworld.com/public/files/Me Myself and Pi/Skirmish Scripts.zip][img]http://www.cncgeneralsworld.com/forums/images/icon_paperclip.gif[/img] Skirmish Scripts.zip[/url] 229.85 KB

Posted by: berkbria - Friday, November 16, 2007 7:00:35 AM
thanks, i will use those scripts in later map but I cant replace the ones on here, they have been edited to make the AI do a bunch of diffrent stuff they wouldnt normally do and attack much harder, so i cant just swap em out on this one.