Posted by: CNC_Mapper - Wednesday, July 18, 2012 6:44:01 AM
How would you script for all teams to have defenses when the game starts?
Posted by: SUPER-G - Wednesday, July 18, 2012 9:13:42 AM
if its for a mission:
place down defence units (like the gatling cannon or patriot missle) like you would place down normal buildings, they are found in different folders, like the gatling cannon is found in the china folder and the patriot missle is found in the america folder.
once you have placed them, if you have made a computer player (AI) that is the enemy then select the object, then click on the arrow on the teams section, then select the team you are using.
if its for a skirmish map:
...i dont know.
Posted by: i^love^mixery - Wednesday, July 18, 2012 10:12:26 AM
as SUPER-G said its important for us to know wether this is going to be a skirmish map or a mission map.
also if its for a skirmish map is it fine if the same buildings spawn for every faction or do you want GLA deffence for GLA players, laser turrets for laser general etc.?
Posted by: SUPER-G - Wednesday, July 18, 2012 10:26:19 AM
you could try making a waypoint and calling it defence1 or something like that.
then you can try to spawn buildings using some script and make them enemies of other players.
Posted by: CNC_Mapper - Wednesday, July 18, 2012 11:04:22 AM
It is for a skirmish map, and i'd prefer laser for laser gen , super weeapon defense for super weapon general..
How would you script it?
Posted by: i^love^mixery - Wednesday, July 18, 2012 11:40:48 PM
the user "Drummin" has already created a map like that but i forgot the name of it. it contains like 1.500 scripts only to spawn default base deffences like that. it can be made a little easier but you will still need around 100 scripts and many hours of copy&paste.
Posted by: krit - Thursday, July 19, 2012 12:03:04 AM
http://www.cnclabs.com/forums/cnc_postst5045_WB-Tut--Identifying-Players-and-Related-Scripts.aspx
Check sections 1, 2, 4, and 5.
(Section 5 actually has a similar script as an example, but it would be helpful to read the other sections first to understand how it works.)
For the map to be fully functioning, with every faction and subfaction getting something unique, you'll need at least 8 x 12 x (amount of map players) scripts. Considering since some subfaction's defenses are the same, the actual numbers would be lower.
Posted by: i^love^mixery - Thursday, July 19, 2012 1:48:12 AM
[quote=Krit;125122]http://www.cnclabs.com/forums/cnc_postst5045_WB-Tut--Identifying-Players-and-Related-Scripts.aspx
Check sections 1, 2, 4, and 5.
(Section 5 actually has a similar script as an example, but it would be helpful to read the other sections first to understand how it works.)
For the map to be fully functioning, with every faction and subfaction getting something unique, you'll need at least 8 x 12 x (amount of map players) scripts. Considering since some subfaction's defenses are the same, the actual numbers would be lower.[/quote]
but as far as i know comps will sell buildings if you transfer them with player -> transfer, right?
Posted by: CNC_Mapper - Thursday, July 19, 2012 7:30:47 AM
That's alot of scripts to use, I have found the map.. Would Ineed exactly the same scripts in my map? Or is there any easier way?
Posted by: CNC_Mapper - Thursday, July 19, 2012 7:38:55 AM
I can't open the scripts up on the map, worldbuilder keeps freezing when i try opening the scripts.
Posted by: SUPER-G - Thursday, July 19, 2012 9:57:47 AM
what computer are you using?
what manufacturer is it from (Toshiba, Acer ect).
my computer is a Toshiba and it doesnt do well with video games, and sometimes with WB too.
maybe that could be the problem.
Posted by: i^love^mixery - Thursday, July 19, 2012 10:16:26 AM
CNC_Mapper you just have to wait. it could take up to 15 minutes. as i said there are 1.500 scripts.
go to another map first and turn off auto verify in the script menu there, then go back to the 1.500 script map and open script menu. that should shorten the process.
and yes there is an easier way. ill take a look into it now.
Posted by: krit - Thursday, July 19, 2012 2:04:43 PM
[quote=i^love^mixery;125123][quote=Krit;125122]http://www.cnclabs.com/forums/cnc_postst5045_WB-Tut--Identifying-Players-and-Related-Scripts.aspx
Check sections 1, 2, 4, and 5.
(Section 5 actually has a similar script as an example, but it would be helpful to read the other sections first to understand how it works.)
For the map to be fully functioning, with every faction and subfaction getting something unique, you'll need at least 8 x 12 x (amount of map players) scripts. Considering since some subfaction's defenses are the same, the actual numbers would be lower.[/quote]
but as far as i know comps will sell buildings if you transfer them with player -> transfer, right?[/quote]
I believe, but is unable to verify, that they will always sell buildings transferred or spawned for them regardless of method, unless you start modifying the actual AI scripts.
Posted by: i^love^mixery - Thursday, July 19, 2012 2:17:31 PM
no they wont sell them if you spawn them.
Posted by: CNC_Mapper - Friday, July 20, 2012 5:25:39 AM
I left it on a went out for a few hours and it did work in the end:), but there is so many scripts!!! And i have never had any problems with the computer teams selling their buildings. Thanks for all the help guys
Posted by: krit - Friday, July 20, 2012 7:02:56 AM
[quote=i^love^mixery;125135]no they wont sell them if you spawn them.[/quote]
Oops. My bad.
Posted by: i^love^mixery - Friday, July 20, 2012 9:17:41 AM
[quote=CNC_Mapper;125145]I left it on a went out for a few hours and it did work in the end:), but there is so many scripts!!! And i have never had any problems with the computer teams selling their buildings. Thanks for all the help guys[/quote]
he sells them ONLY if you use the script player -> transfer. he does NOT sell them if they are spawned for him directly.
he does that probably because of the black lotus backdoor attacks or something like that..
Posted by: i^love^mixery - Friday, July 20, 2012 3:15:27 PM
i thought about it a little and came up with an easier solution just now..
for USA on a 4 players map you would need the following 4 scripts in the USA script folder:
[code]
*** IF ***
Player '' starting position is 1 .
*** THEN ***
Spawn Unit 'B_1_01' of type 'AmericaFireBase' on Team 'teamSkirmishAmerica' at waypoint Waypoint 'B_1_01'
[/code]
[code]
*** IF ***
Player '' starting position is 2 .
*** THEN ***
Spawn Unit 'B_2_01' of type 'AmericaFireBase' on Team 'teamSkirmishAmerica' at waypoint Waypoint 'B_2_01'
[/code]
[code]
*** IF ***
Player '' starting position is 3 .
*** THEN ***
Spawn Unit 'B_3_01' of type 'AmericaFireBase' on Team 'teamSkirmishAmerica' at waypoint Waypoint 'B_3_01'
[/code]
[code]
*** IF ***
Player '' starting position is 4 .
*** THEN ***
Spawn Unit 'B_4_01' of type 'AmericaFireBase' on Team 'teamSkirmishAmerica' at waypoint Waypoint 'B_4_01'
[/code]
so you would need 8x12=96 scripts on a 8 players map to cover all factions and all spots. still something but way better than 1.500+. this is definitely the easiest way there is.
but you would still need to import the entire AI scripts into your map because the comps dont work once you put scripts into their scipt folders(drummin did the same thing in his map).
but there is a bug about the scripts and the order of them is screwed up once you import them and i am not too sure how to fix it.
also this scripts will only work for skirmish players but i could come up with a solution for human players too IF you decide to go this way (yes/no?).
Posted by: krit - Friday, July 20, 2012 4:20:08 PM
And if I recall correctly, it also crashes if there's more than one AI player using the American faction...
Posted by: i^love^mixery - Saturday, July 21, 2012 2:48:09 AM
[quote=Krit;125157]And if I recall correctly, it also crashes if there's more than one AI player using the American faction...[/quote]
nope i tested it. it works.
Posted by: CNC_Mapper - Monday, July 23, 2012 1:37:24 PM
Hey again. I've tried the;
*** IF ***
Player '' starting position is 2 .
*** THEN ***
Spawn Unit 'B_2_01' of type 'AmericaFireBase' on Team 'teamSkirmishAmerica' at waypoint Waypoint 'B_2_01'
But it hasnt seemed to work
Posted by: i^love^mixery - Monday, July 23, 2012 2:52:09 PM
it works (but only for skirmish players). ive built a test map and it worked perfectly so there must be a mistake in your scripts.
Posted by: CNC_Mapper - Tuesday, July 24, 2012 7:23:11 AM
oh.. So how would I get it to work for the actual player?
Posted by: i^love^mixery - Tuesday, July 24, 2012 1:01:49 PM
[quote=CNC_Mapper;125187]oh.. So how would I get it to work for the actual player?[/quote]
that one will be tricky but it is possible if you know what you are doing.
the scripts will have to be in PlyrCivilian folder.
you will need 3 things:
- timer scripts
- Spawn scripts for each faction and base in folder PlyrCivilian -> SPAWN (create that folder and make it disabled by default)
- transfer scripts for each player in folder PlyrCivilian -> TRANSFER (create that folder and make it disabled by default)
timer scripts:
[code]
*** IF ***
true
*** THEN ***
set timer 'spawn' to expire in 0.10 seconds.
set timer 'transfer' to expire in 0.20 seconds.
set timer 'stop' to expire in 0.30 seconds.
[/code]
[code]
*** IF ***
spawn expired
*** THEN ***
enable script SPAWN
[/code]
[code]
*** IF ***
transfer expired
*** THEN ***
enable script TRANSFER
[/code]
[code]
*** IF ***
stop expired
*** THEN ***
disable script TRANSFER
disable script SPAWN
[/code]
spawn scripts (for each faction and start position, so up to 8x12=96 scripts on an 8 players map), all of them in SPAWN script folder
Condition:
Player -> Area -> Player has comparison unit type in area
[code]
'player0' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player1' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player2' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player3' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player4' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player5' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player6' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
or
'player7' has Equal To 1 structure of type 'AmericaCommandCenter' in the area 'InnerPerimeter1'
*** THEN ***
Spawn unit base_01_def_01 of type "USA patriot whatever" for player PlyrCivilian at area base_01_def_01
Spawn unit base_01_def_02 of type "USA patriot whatever" for player PlyrCivilian at area base_01_def_02
Spawn unit base_01_def_03 of type "USA patriot whatever" for player PlyrCivilian at area base_01_def_03
[/code]
transfer scripts, all of them in TANSFER script folder, needed for every base and every player, so up to 8x8=64 scripts.
this are ALL the transfer scripts needed for base 1, you will need the same scripts for EVERY base. all you have to change is the base_0X_def_01 and the starting position according to each possible base.
[code]
*** IF ***
Player 'player0' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player0'
Unit 'base_01_def_02' is transferred to the command of Player 'player0'
Unit 'base_01_def_03' is transferred to the command of Player 'player0'
*** IF ***
Player 'player1' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player1'
Unit 'base_01_def_02' is transferred to the command of Player 'player1'
Unit 'base_01_def_03' is transferred to the command of Player 'player1'
*** IF ***
Player 'player2' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player2'
Unit 'base_01_def_02' is transferred to the command of Player 'player2'
Unit 'base_01_def_03' is transferred to the command of Player 'player2'
*** IF ***
Player 'player3' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player3'
Unit 'base_01_def_02' is transferred to the command of Player 'player3'
Unit 'base_01_def_03' is transferred to the command of Player 'player3'
*** IF ***
Player 'player4' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player4'
Unit 'base_01_def_02' is transferred to the command of Player 'player4'
Unit 'base_01_def_03' is transferred to the command of Player 'player4'
*** IF ***
Player 'player5' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player5'
Unit 'base_01_def_02' is transferred to the command of Player 'player5'
Unit 'base_01_def_03' is transferred to the command of Player 'player5'
*** IF ***
Player 'player6' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player6'
Unit 'base_01_def_02' is transferred to the command of Player 'player6'
Unit 'base_01_def_03' is transferred to the command of Player 'player6'
*** IF ***
Player 'player7' starting position is 1 .
*** THEN ***
Unit 'base_01_def_01' is transferred to the command of Player 'player7'
Unit 'base_01_def_02' is transferred to the command of Player 'player7'
Unit 'base_01_def_03' is transferred to the command of Player 'player7'
[/code]
REMEMBER: this way will ONLY work for human players. if you want to get ONLY human players to work then THIS is all you need.
if you want to enable both, human and comp players then you will need to use BOTH methods.
this might look like too much but that are only ~164 scripts. (+96 more scripts if you want skirmish to work too). its a lot but still nothing compared to the 2.000 (or even more) scripts in that one map you have found.