Posted by: Calculus - Monday, July 16, 2012 6:43:29 PM
Hello people this is my first time having a go at C&C world builder, and so far my map is going ok, but I have a problem: I have made a working train track, with waypoints and all the right things to get the train to move but the problem is the train won't take any damage and I can't and neither can the AI attack it. It just ploughs straight through the AI base, smashing buildings and stuff, and they won't attack. I checked with the properties tab and it's not on indestructible but it just wont die. HOW DO I SOLVE THIS. Additionally, I need to know how to make another train respawn in its place but that's not main priority. Thank you!
Posted by: SUPER-G - Monday, July 16, 2012 7:05:08 PM
[quote=Calculus;125058]but the problem is the train won't take any damage and I can't and neither can the AI attack it. It just ploughs straight through the AI base, smashing buildings and stuff, and they won't attack.[/quote]
you will need to make a special script for that, unfortunetly, i dont know how to make it work. however you can try making a separet team and making the train join that team, then you will have to find a way to make it an enemy of skirmish players: player0 to player7. if you want to attack it, then check mark it as targetable (in the object properties window).
[quote=Calculus;125058]I checked with the properties tab and it's not on indestructible but it just wont die.[/quote]
trains have lots of health, and they dont take damage from hitting buildings either. so they arent indestructible, just lots of health!
[quote=Calculus;125058]I need to know how to make another train respawn in its place but that's not main priority. Thank you![/quote]
if the train make a full loop, then you wont have to respawn a train. besides, i dont know how to respawn them anyway!
Posted by: Calculus - Tuesday, July 17, 2012 2:52:28 AM
Thanks for the insight, that has sparked a few ideas to see how to fix this, and I wasn't sure how much health a train has, I will see what I can do to solve this
Posted by: SUPER-G - Tuesday, July 17, 2012 8:31:14 AM
great! hope it works out for you!
[sunglasses]
Posted by: i^love^mixery - Tuesday, July 17, 2012 9:30:31 AM
hello calculus.
if you want to make this train hostile to all players then you will have to create a new player:
do Edit -> Edit Player List
click New Player
Chose FactionBossGeneral
mark "is player computer controlled"
give it a player name and a display name (example: Enemy)
now go to scripting menu, create a new script in PlyrCivilian Folder and write down the following actions with this script:
Player -> Alliances -> Player to other player.
make all this script lines:
player0 to player Enemy to be enemy
player1 to player Enemy to be enemy
player2 to player Enemy to be enemy
player3 to player Enemy to be enemy
player4 to player Enemy to be enemy
player5 to player Enemy to be enemy
player6 to player Enemy to be enemy
player7 to player Enemy to be enemy
player Enemy to player0 to be enemy
player Enemy to player1 to be enemy
player Enemy to player2 to be enemy
player Enemy to player3 to be enemy
player Enemy to player4 to be enemy
player Enemy to player5 to be enemy
player Enemy to player6 to be enemy
player Enemy to player7 to be enemy
now you can put the train to the team "Enemy" and it will be hostile towards all players.
also the train is not indestructible. it is just hard to hit and has A LOT of health points. you can of course reduce the health points of the train in the object properties window (Max HP value. something like 3.000 should be fine).
you can make the train respawn pretty easily, but reducing its default health points is not possible (same goes for any other SPAWNED unit or team). if you still need this then i could explain this to you too.
Posted by: Calculus - Tuesday, July 17, 2012 1:24:38 PM
this is definatly a lot of help thank you but i am new to scripting and not sure as to how i input this information. What i have done is left script conditions as 'true' and have added the script Player'???' considers Player'???' to be enemy to actions if true, but it still doesnt work. plus the script has a little question mark on its icon, this means what? thanks you for the help so far this will definately work, the only problem is me,
EDITED: also, it says that 'player0' (it happens for all the players) does not exist when i replace the ??? with a player
Posted by: i^love^mixery - Tuesday, July 17, 2012 4:34:33 PM
[quote=Calculus;125079]EDITED: also, it says that 'player0' (it happens for all the players) does not exist when i replace the ??? with a player[/quote]
that is normal. you can ignore the ??? in that case.
just make a player and write down the script lines that i mentioned.
condition 'true' is correct. you dont need to change anything besides the script actions.
Posted by: Calculus - Wednesday, July 18, 2012 12:14:08 PM
okay then so i would put in the space of '???' just the number of the player or 'player1' (sorry i have dragged this out so long i am just a little too finicky) and do capitals or spacing change anything? Also I realsised that the train under the properties menu had not been ticked under targetable or selectable and i am beginning to wonder whether this could have just been the problem?...ALSO do i need to include the AI generals under the coding thing for skirmish maps or are they included amongst the players? again, im sorry i keep probing your mind and i really do appreciate the help i have had so far!
Posted by: i^love^mixery - Wednesday, July 18, 2012 11:08:51 PM
[quote=Calculus;125112]okay then so i would put in the space of '???' just the number of the player or 'player1' (sorry i have dragged this out so long i am just a little too finicky)[/quote] you need to write player0, player1, player2, player3, player4, player5, player6 and player7.
it cant be made any more simply than with my first reply[grin]
[quote=Calculus;125112]and do capitals or spacing change anything?[/quote]
they do..
[quote=Calculus;125112]Also I realsised that the train under the properties menu had not been ticked under targetable or selectable and i am beginning to wonder whether this could have just been the problem?...[/quote]
that wasnt the problem. "selectable" and "targetable" means something else. AI wont attack it if its just "targetable".
[quote=Calculus;125112]ALSO do i need to include the AI generals under the coding thing for skirmish maps or are they included amongst the players?[/quote]
this is how you make the AI build in a skirmish map:
http://www.cnclabs.com/maps/generals/worldbuilder/tutorials/basictutorial/#addingPlayers
the AI scripts will be added to your map automatically as long as you stick to this guide.
Posted by: NewNightmare - Friday, July 20, 2012 5:43:33 AM
For the health/indestructibility problem, you can overwrite the HP it will spawn with in the object properties window, next to the 'selectable' and other tickboxes; just select 'other' from dropdown list, and give it a number in space next to it (for a guide, normal tanks have 400-500 hp).
OR, if you want the train to keep respawning, and have lower health, you'll to edit it's unit code via a map.ini file, but setup the scripts first, then we'll take care of the HP balance.