|
Post by papadan56 on Nov 13, 2009 14:26:40 GMT 1
could please someone explain how to create a mobile reinforcement group of tanks with script idea 2200 so that they only provide support if needed to the defense position.
first i am creating a defense position then i am creating a group of tanks with script 2200 save the map and play it....the thanks are going directly to my base to attack me instead of waiting to support the defensive position
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Nov 13, 2009 16:53:17 GMT 1
Let's say your defense units have ScriptID 2199
function TankSupport() if (GetNUnitsInScriptGroup(2199, 0) < 1) then RunScript("Reinforce", 1000); Suicide(); end; end;
In this function Reinf will happen when your 2199 are less then 1, you can change this value to whatever you like of course... or create it under another condition...
function Reinforce() LandReinforcement(0); Suicide(); end;
In the MapEditor you create reinforcement group 0 with ScriptID units 2200. There you can also use the Start Command or write this in Lua:
function Support() Cmd(3, 2200, 0, 5676, 8749); Suicide(); end;
In this example, they will swarn to x-y coordinates. You could script it differently of course...
|
|
|
Post by papadan56 on Nov 13, 2009 18:57:29 GMT 1
Sorry, i have try it...but,as soon as they are activated instead of going to the defense position they rush to my base to destroy me... i went true the maps of the game,but i don t see any clue.. on how to fix this...
but thanks anyway for your help...
|
|
|
Post by jeffcanada on Nov 14, 2009 3:40:41 GMT 1
I would suggest to create a scriptarea around your defensive line, let's say "defense".
Like Kaoz stated, use a Cmd like this one:
function Support() Cmd(3, 2200, GetScriptAreaParams("defense")); Suicide(); end;
This way the reinforcement should go to the scriptarea "defense".
You should also check that there is no command set under the mapeditor given to the units.
Good luck.
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Nov 14, 2009 4:05:09 GMT 1
the thing confusing me here, is that you (player 0) need support coming to your defense position, right? when you say they come to your base and destroy you, they must be set as AI enemy, player 1, no?
|
|
|
Post by LouisXIV on Nov 14, 2009 12:58:52 GMT 1
You don't need scripting, this is one of the beauties of Blitzkrieg. If you want some armour for Player 1 to reinforce one or more Player 1 defensive positions when they are attacked do the following:
(I'm sorry I can't give you the proper terms, but my MapEd won't work, so I can't refresh my poor memory about what the proper names are. I hope someone else who understands my response will clarify it.)
Set a reinforcment circle circle using the proper tool in the MapEd around each of your defensive positions. Set a further one in the rear areas of your map. Place one or more tanks in the last circle. Set the small circles under them so they have a place to return to. Give your tanks a Script ID of 2200. Then go to the reinforcement tab under Ed tools and create 2200 as a reinforcement group. Then, when you run your map, the 2200 tanks will move forward to attack any enemy spotted in any of the reinforcement circles, then the survivors will automatically return to their small circles when the enemy is defeated or has retired. Player 1 ground attack aircraft will also automatically come to attack any enemy forces seen in the defensive circles.
You can also set trucks, support trucks and ambulances as mobile reinforcements in exactly the same way, even with the same Script ID. They will come forward to replenish ammunition, replace infantry and artillery crews, repair equipment and heal wounded soldiers.
You can also do this for Player 0, but you will have to place Player 0 replacement circles. Then tanks will come forward to support your attacks within those circles and trucks will replace/repair/heal, but only within friendly reinforce circles.
(Can someone please post the appropriate terms and tabs to use so that people can understand how to use this?)
|
|
|
Post by papadan56 on Nov 14, 2009 14:49:35 GMT 1
To LouisXIV,
I am using the mapeditor, in the middle of my map i have a bridge owned by The player 1, now i am gone Set the AI parameters, first the Defence (green) - defensive position;one large green circle with 5 small green circle inside. at the other end of the map,i put a Reinforce (yellow) - initial reinforcements' positions;one large yellow circle with 3 smaller one inside, each of the small yellow circle is under a tanks with the script id 2200. now that the defense and reinforcement position are set in the position tab. i will now add in the mobile reinforcement tab,the script id of the mobile reinforcement...2200. and then save my map and try it... as soon as the map is loaded my 3 tanks with script id 2200 are going to player 0 base to attack it...they should be waiting that the bridge player 1 needs help... thanks
|
|
|
Post by LouisXIV on Nov 15, 2009 13:13:10 GMT 1
papadan56, I think what your problem is is that you are using the yellow reinforce circle. For some reason that doesn't seem to work. Use the green circle, even for your mobile reinforcements. That seems to work properly.
If you want to see how it is done, use the Map Editor to generate a random map, then look at how they have the reinforcement system set up on the map that is created. You'll see they use only the green reinforcement circles. Copy how they are doing it and I think you will find it works very well.
You can also combine this with scripting. For instance, in the random maps, as soon as your troops attack anywhere, they get clobbered by the mobile reinforcements. After you destroy them, the rest of the map is a bit of an anti-climax.
To improve this, you can also set your mobile reinforcments as a reinforcement group. Then you can bring them on with scripting any time you want using LandReinforcement. I like to delay their arrival until later on in the mission. Alternately if I want to make it a really tough mission, I can bring on the mobile reinforcements every 15 minutes or so, or check to see if they are all gone and then land them about 2 minutes later. Or you can land them after every objective is accomplished; that way the attacker will be counterattached every time he attacks, which is more realistic.
I also like to separate out the mobile reinforcements from the support trucks. Tanks are ScriptID 2100; trucks are ScriptID 2101. That way I can keep checking the trucks, and if they are all destroyed I can land some more.
(One easy way to cripple a random map mission in BK is to have your sniper sneak around until he can get a good view of an enemy artillery piece. Have him shoot one or more crewmen, then wait. When a support truck comes around, he shoots the truck. He keeps doing this until no more support truck arrive. Then you can attack and the enemy crews and infantry won't get replaced. It makes the mission a lot easier.)
|
|
|
Post by papadan56 on Nov 15, 2009 15:08:16 GMT 1
To LouisXIV, i will try that. thank you.
|
|
|
Post by jeffcanada on Nov 15, 2009 17:16:08 GMT 1
Louis, I remember that you explained how to work with reinforcement circle in the past forum. I would be very interested in kind of tutorial with pictures of it once your mapeditor works.
I never used it but it seems very useful.
|
|
|
Post by LouisXIV on Nov 15, 2009 19:01:51 GMT 1
The MapEd contains a lot of great features like that. You can create some pretty interesting missions without bothering to script.
|
|