Sign in to follow this  
Followers 0
kronzky

Dynamic Mine Field

86 posts in this topic

is it possible for you to include some other types of mines into it?

If you are referring to the visible mine models: You can use this script with any mines that have been created for ArmA (check the readme to see how to define the name of the mine model).

I myself am not a modeler, so it's unlikely that there will ever be any other models included with this script.

If you are referring to the functionality of the mine (Anti-Personnel, Anti-Tank, Claymore, etc.), all those different behaviours can be defined via the calling arguments.

Share this post


Link to post
Share on other sites
Beautiful script but one problem I'm having is large numbers of mines have a severe impact on my fps (fine 3 sec, freeze 3 sec, ect). I assume this is because the script checks for targets around each mine. I was wondering if it would be possible to check for mines around targets instead (there tends to be less people than mines) or maybe a addition to the script that checks to see the mine to target ration and checks around the lesser.

I'm totally clueless about scripting so if what i said made no sense feel free to mock me mercillesly.

Same here on a 5+ GHZ Machine...

Having a Field with 160x8 and a density of 3.

I think it because of the many objects created but its just a assumption...

I hope this is somehow fixable? Does the Server taking the "work" so it would run smooth on the clients machines (if the the above assumption is tend to be untrue)?

Anyway great script!

Regards, Christian

Share this post


Link to post
Share on other sites

I looked a bit further into this issue... I played my mission on a server with my machines as client and it seems that all enemy units are "beaming" every 1.5 or 2 seconds - exactly that time of hangin i had while testing local...

Inside the minefield.sqf i found the follwing lines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if !(local server) exitWith{};

// replace the above check with the following line for ArmA 1.06 and higher

// if !(isServer) exitWith {};

I will replace those lines now like mentioned and check if that helps.

By the way:

Here is my intialising-line which i placed inside the main gamelogic called server:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul=["minefield1", "trigger:","AllVehicles", "ammo:","Sh_120_HE", "mine:","MineE", "height:",0.025, "showsigns:","Danger", "side:","west", "range:",1.8, "density:",2 ]execVM "minefield.sqf";

EDIT: I replaced the line and checked, no change!

Then i found a other thing at the very end, called "sleep 1".

If you change "sleep 1" to "~1" this "hanging" every second is gone. But now you'll get a bunch of error messages on missionstart.

Kronzky, help us!

Regards, Christian

Share this post


Link to post
Share on other sites
EDIT: I replaced the line and checked, no change!

Then i found a other thing at the very end, called "sleep 1".

If you change "sleep 1" to "~1" this "hanging" every second is gone. But now you'll get a bunch of error messages on missionstart.

Why that doesn't work is since "~1" for sleeping the script only works in .sqs scripts. In .sqf it has been replaced by "sleep 1;" so it need to be as it is.

Possibly that you could try to increase the sleep time to two seconds?

To me it seems like the problem is that it checks for all mines at the same time. If one spread out the minefield calculations over a period of time (for example by spacing the spawning of each mine with 0.005 seconds or something).

Another method as mentioned above would be to try to rewrite the script so that it checks for mines near units, rather than units near mines, it would have a lot less calculations to do.

At least when not near mines it would be a smaller workload. When near mines it would probably have to start checking what kind of mine and so on for if they are infantry or vehicle mines, the manner of how you make them detonate (wire, pressure-fuze, magnetic fuze, laser, etc.) and so on. Hopefully less work for the server than what it is now though.

Share this post


Link to post
Share on other sites

The mine field is not really a practical solution if you want to cover larger areas (for that a simple trigger would be more appropriate), but it's purpose is to slow down small, crucial choke points.

Also, if you do need several areas protected by mines, keep in mind that you can create the mine fields on the fly, and also remove them, once they're not needed anymore. That should reduce the workload somewhat.

Share this post


Link to post
Share on other sites

So you wont provide any fix?

As i said while replacing sleep 1 wit ~1 it had run smooth and everything worked, exept of some error-messages at the beginning.

So there must be a workaround!

Please help us, this script is so great!

What it the method mentioned with the trigger?

In this method can i still use some variables like distance for setoff, side, blast, and last but not least which vehicle it could setoff?

In Addition would i still see the mines and can disable them?

Regards, Christian

Share this post


Link to post
Share on other sites

Unfortunately, I'm busy with other stuff right now, so I won't really have time to look into this.

But if removing the sleep command fixed the problem for you, then just go with it. (No idea why this would have a positive effect, but I guess that doesn't really matter...)

I think though, that Inkompetent's suggestion of staggering the creation of the mines sounds promising (and makes a lot more sense), but you (or he) would have to try it out yourself.

As far as trigger usage is concerned - all those things you mentioned would be doable, but you'd have to do some reading-up on triggers and ArmA scripting to pull it off...

Share this post


Link to post
Share on other sites

Thanks for your answer, regarding to the sleep-comand issue:

I dont removed the "sleep 1" command, i just replaced it with "~1".

I've tried to remove it aswell, but that time my whole pc freezes. Of course i double- and triple checked that with the same conclusion every time.

If just could remove all those error messages.... that would be enough sad_o.gif

Isn't there someone other scripter who can help me? I think a solving of this issue shouldnt be to hard...

Regards, Christian

Share this post


Link to post
Share on other sites

Any idea why "side west" isn't working properly?

I got on trigger:

nul=["r", "trigger:","LandVehicle", "side:","WEST", "count:",150, "range:",3, "showsigns:","danger"] execVM "minefield.sqf"; minetest=false

And as i tested it on editor with AI:

West Hummer: Detonation

East UAZ: No Detonation

West Abrams: Detonation

East T-72: Detonation

East BMP-2: Detonation

East Ural: No Detonation

Trying make mp mission where East (AI) have minefield, and don't want them blow up their own vechiles on it, instead players side west should blown up to pieces when enter minefield.

Share this post


Link to post
Share on other sites

I think that's because the mines were never made to be "side" dependent. In other words, like the real things, they do not discriminate who they blow up just like the standard BIS mines.

Solution- Keep friendly AI away from minefields. Minefields are generally part of defensive strategy designed to slow down or stop an enemy's advancement as well as to channel the enemy into pre-positioned kill-zones of interlocking fire and pre-positioned artillery strikes. They can also protect your flanks from surprise attacks. Generally its not a good idea to place them protecting your rear as that can cut off avenues of escape.

What is missing now are anti-mine rollers put on tanks as well as rocket launched line charges or anti-mine fuel-air artillery.

My mod had both the rollers and FA artillery in OFP and hope to eventually import those capabilities into ArmA so that you can clear paths through minefields for your AI units.

Chris G.

aka-Miles Teg<GD>

Share this post


Link to post
Share on other sites
I think that's because the mines were never made to be "side" dependent. In other words, like the real things, they do not discriminate who they blow up just like the standard BIS mines.

That still doesn't explain why humwee detonates mine and uaz/ural doesn't. And what i did understand from this script it should work with sides properly. I'm not looking realism here as i am looking stupid AI not blowing himself up, problem is that minefield is beside AI base and when AI encounter westside (players) it rolls tanks into minefield. So any helps solving this appreciated very much otherwise i have to remove whole minefield and i don't like that option very much.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0