|
Post by schrad on Mar 7, 2015 13:57:37 GMT 1
Hi,
something what i dont like at Bk, the enemy tanks can go through his own minefields?! I think its not really realistic. A other point what i dont like, if my infantry recognizes a minefield and tag the mines with flags but my vehicles drives still through the field and become destroyed! Is this not possible to change this?
|
|
|
Post by Herr Kodax on Mar 7, 2015 14:34:29 GMT 1
Yeah, to be honest, I'd also like to know if we can change the mines to be 'neutral' (blow up anything that runs over them, regardless who set them).
|
|
|
Post by ariete on Mar 7, 2015 23:34:32 GMT 1
unfortunally, despite detected, our stupid troops or trucks in movement go on the mines quetly (this is worst of the enemy skill to run on the waters ...). it need to clear well a minefield before move who left in the rears.
|
|
|
Post by Major Pain on Mar 8, 2015 0:49:51 GMT 1
If your Engineer Lays Mines, the Mines belong to you, thus your units will not suffer damage if they run over/through them.
If the AI (Player 1) lays mines, the AI units do not suffer damage if they run over/through them.
If Player 2 (Neutral Player) is set to Enemy to both the Human (Player 0) and the AI (Player 1) then all Player 2 Mines will cause damage to both Players. This only works if the mines are already on the map and belong to Player 2.
You can Script Player 2 to lay mines in an area. Those mines will also damage both Players.
You can change the Mines within an Area to Player 2 if either the Human or AI lay mines on the map. You can create a Function to check for new mines, which triggers the Change Owner Function. Then all mines damage both the Human or the AI Units.
So there are work-arounds for this.
Everything has a price Gentlemen...
|
|
|
Post by ariete on Mar 8, 2015 2:25:41 GMT 1
but in fact it has few sense if the AI take damage from its mines, it's an handicap which it can solve just with a function focused on that mined area ... but high level here major! for the common people is a consistent semplification the fact for which AI doesn't take damage from its mines
|
|
|
Post by keepitsimple on Mar 8, 2015 11:12:46 GMT 1
Laying neutral mines is nice idea. Hence, I started the thread Neutral mines in Map Making Help so this tip isn't lost. Major Pain could you give there the script for change mines that a player put on the map to neutral.
|
|
|
Post by Major Pain on Mar 9, 2015 0:59:24 GMT 1
The Script is pretty straight forward.
Mines that are added to a map must have a ScriptID#. Example: Mine ScriptID= "5000"
Use ---> ChangePlayer(5000, 2) to change Mines to Player 2.
Player 2 must be set to enemy for both players.
This is proven method: Lay mines on the map and set to Player 2. Or change the ownership of Mines with ScriptID. This can be useful if you want to add Minefields by Script. They can be turned on or off using the LandReinforcement(5000) or DeleteReinforcement(5000) Commands.
I might add that the LandReinforcement(ScriptID) and DeleteReinforcement(ScriptID) Commands are useful for adding and removing any kind of objects; like stones that block a pathway.
Assuming you want to change new mines to Player 2. Much like calling paradrop, you can assign a ScriptID.
The Function should change all new mines to Player 2. This needs to be tested to ensure the correct syntax.
You must first define a Script Area in the Map build. Example Script Area = "MineZone1"
You can check for the existence of mines in a Script Area using:
GetNMinesInScriptArea(MineZone1) <------ This gives you the number of mines within the area.
The problem is creating new objects with a ScriptID. While this can be done on para-units... the theory should hold for any type of 'new' object. Specific Objects must be defined in the Init().
SetIGlobalVar( "Mine_AT.ScriptID", 5000);
** It is important when using SetIGlobalVar( "OBJECTNAME.ScriptID", iScriptID) to use the Object Name found in the Objects.xml.
<item>
<name>Mine_AT</name>
<type>sprite</type>
<game_type>mine</game_type>
<path>objects\simpleobjects\common\Summer\Mine\Mine_AT</path>
</item>
If the Script is used to have a player's Engineer (ScriptID = 3100) to lay mines using Cmd(11, 3100, MineZone1) only two mines will be laid at the center (x, y) of Script Area MineZone1.
To lay a minefield of any size, the x, y coordinates must be defined. You can create a Function that changes the x and y incrementally by 1 or -1 at each pass. You can use the Qmd command to add additional x, y coordinates.
The Script does not differentiate between AP and AT mines. I have not used the Cmd function to lay mines... so I'm not sure what mines are laid by the Engineer. But I believe the Mine_AT mine will be the default.
Mines laid by Player 2 will not require a ScriptID since they will already effect the Human and AI Units.
|
|