Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Need help making a new mine type

  1. #1

    Need help making a new mine type

    I am working on a water mine (or nautical mine, if you prefer) in anticipation of the underwater diving module. I'm stumped.

    It seems that making a new mine that inherits from the default mines (Minemine and MineMineE) doesn't work. Arma complains with all the "no entry..." errors. The issue APPEARS to be that the MineGeneric vehicle - which is the (private) parent of the mines in the cfgVehicles section - is a "root" object. It doesn't inherit from default; it is simply "class MineGeneric". So I tried adding the mine as a Buoy - no problems. It is a mine-shaped buoy! This is it ingame as a mean-looking buoy:



    Anything I do trying to get the mine to appear in-game either generates the "no entry" errors or causes an access violation. I looked at other mine addons, and no one has done what I am trying to do... inherit from the default mine configs. For example, JTD Mines uses a nonstrategic "Thing" object, and scripts. The SC9 naval buoy (from Arma) used a trigger in the init to damage nearby vehicles. If there's a mine object that inherits from defaults I've overlooked it. So it seems to me that the default BIS mines are hard-coded in such a way that hinders the addition of more mines.

    Here is my config - as you can see, it is copied/pasted from the default mine configs. I've tried several different iterations (including changes to the inheritance as per the weapons_e config) and nothing changes the behavior. The issue is always a problem with the Vehicle section.

    Thoughts?

    Spoiler:

  2. #2
    Warrant Officer Abs's Avatar
    Join Date
    Jan 28 2007
    Location
    Sector 001
    Posts
    2,421
    I don't see why BIS would do that.

    Can you put in the exact error messages you're getting, please?

    Abs
    My Projects:

    RHS Contributor | Former ONS Member | Former W'39 Member
    I will not be taking part in the contest, but I support it 100%! Great idea, BIS!

  3. #3
    I think something is hard-coded and it only looks for those two entries (but I'm hoping not!) so I think it is accidental. Something to do with the thoughts that a mine is technically a vehicle (like static guns) that is activated by another vehicle.

    If I borrow a page from the JTD Mines playbook and make the mine inherit from "Thing", it becomes a static object that does nothing.

    If I make the mine inherit from the "BuoySmall" object, it becomes a mine-shaped buoy and has no explosive interaction with anything.

    If I add the "vehicleClass = "Mines";" to the config and it doesn't inherit from the "MineGeneric" weapon vehicle, it will AV with nothing in the report. >>> This is what leads me to guess there is something hard-coded or otherwise a non-config issue.

    EDIT: As I'm typing this I thought of a hack that might work as a suitable workaround - using an init script to "attachto" a default mine to it. I'm not sure if it needs the "put" action to arm it but that should be scriptable.

    Here's the RPT from my config that inherits directly from the MineMine vehicle. Same AV whether it inherits from "MineMine", "MineMineE", or "MineGeneric". It allows you to place it in the editor, then AV's to desktop when you try to preview. The first few "no entry" is perhaps the most telling - note that it says "no entry" for the MineMine vehicle, which I copied directly out of the BIS config.


    Warning Message: No entry 'bin\config.bin/CfgVehicles/pook_watermine.simulation'.
    Warning Message: '/' is not a value
    Unrecognized CfgVehicles simulation in bin\config.bin/CfgVehicles/pook_watermine/
    Warning Message: No entry 'bin\config.bin/CfgVehicles/pook_watermine.simulation'.
    Warning Message: '/' is not a value
    Warning Message: No entry 'bin\config.bin/CfgVehicles/MineMine.simulation'.
    Warning Message: '/' is not a value

    I removed the AV details from the dump:
    Spoiler:
    Last edited by hcpookie; Apr 2 2012 at 15:44.

  4. #4
    Well no matter what, I can't get the mine to behave like I want it to. Regardless of how it is configured, or what model it uses, it will still only react to ARMOR class vehicles. So if a non-armor class vehicle approaches it, it simply won't do anything. So the mine inheritance question seems to be a hard-coded config that is intended to make the anti-tank mines work ONLY as anti-tank mines, which makes sense when you think about it like that. SO... unless I find something else, I think I'm forced to use an event handler solution to make the mine trigger against SHIP class vehicles.

  5. #5
    Hi all! I'm working on the script to make this work. I'm borrowing heavily from the numerous existing scripts and examples but this is going in a slightly different direction. I'm at a stoppage right now. Whatever I do, I can't get the trigger to attach to the object. I've tried several different ways to do it and nothing is working like others have reported it should be working. I spent several hours last night tweaking the script. I think the correct way to do this is to use the "isKindOf" filter like others have posted:

    this && ({_x isKindOf "SHIP"} count thisList) > 0
    However I can't make this work at all. I have set it to "> 1". The reason I think "> 1" should work is that the water mine is a ship object so it behaves properly in water. Setting this line to the original "> 0" means the instant the mine is spawned the trigger is activated. It seems no matter how I configure it, it simply doesn't work so I am guessing there is a syntax error in how I'm trying to interrogate "thisList". Currently I can make the trigger activate with a simple "countType" so isKindOf may not be necessary. I have gotten it to work with _count > 0 but it doesn't seem to like when I add "this &&" as per the isKindOf example. The point of the _count usage is simple - only set off the mine if more than 1 ship object is in the trigger area. Mine = 1 ship; "any target ship" = 2 ship. That, from my understanding, should make the water mine behave properly.

    The CURRENT problem is that the attachTo doesn't work with a trigger, although several posts say it should. I have added a marker to it so I can see where it is on the map. I'm setting it at 0,0,0 because I can't get it to accept the _pos variable no matter how I set it. Always get the "only one parameter was passed but there should be three" prompts in the RPT. So setting it at 0,0,0 and then attachTo the mine vehicle seems to be the logical solution. Thinking maybe it is sinking to the ground (below water level) I have tried setPosASL and it makes no difference.

    Here's what I have right now after some more tweaking and trying different iterations - anyone smarter than me see what is probably an obvious script problem?

    Code:
    _mine = this select 0;
    _count= "SHIP" countType thisList;
    _pos = [(position _mine select 0), (position _mine select 1), (position _mine select 2)];
    
    _trg = createTrigger ["EmptyDetector", [0, 0, 0]];
    _trg setTriggerArea [1, 1, 0, false];
    _trg setTriggerActivation ["ANY", "PRESENT", false];
    _trg setTriggerStatements ["this && (_count > 1)", "hint 'trigger on'; _ammo = 'ARTY_Sh_82_HE' camCreate (getPos _mine); _mine setDamage 1; deleteVehicle _trg", ""];
    
    //_trg attachTo [_mine,[0,0,0]]; // this didn't work either
    _trg setPosASL [_mine, [0,0,0]];
    
    sleep 3;
    hint 'marker time';
    
    _MINEMARKER = createMarker ['Water_Mine', [(position _trg select 0), (position _trg select 1)]];
    _MINEMARKER setMarkerShape "ICON";
    "Water_Mine" setMarkerType "Marker";
    "Water_Mine" setMarkerText "Water Mine";

  6. #6
    Hmm
    Maybe you can make a buoy class item and give it very low armour but big destruction value
    Thi is just idea , I know it's possible but wether the ability to destroy a near object is possible without script would need investigation .

  7. #7
    I'm really close... I cna manually make a trigger that activates when a ship comes near it and blows up the ship. So I'm certain this will work. the problem is my script-fu is weak

    I've been looking over some script examples and I'm going to try a few more things I haven't attempted yet. I'm guessing that my script is incorrectly written and so no info is getting passed along to the trigger.

  8. #8
    Making progress! Sat down with a cup of coffee and worked through my problem. I wasn't properly passing "this" and now it is partially working. I found a new problem of course LOL

    Code:
    // if (isDedicated) exitWith {};
    
    _mine = _this;
    _pos = getPos _mine;
    
    _trg = createTrigger ["EmptyDetector", _pos];
    _trg setTriggerArea [5, 5, 0, false];
    _trg setTriggerActivation ["ANY", "PRESENT", false];
    _trg setTriggerStatements ["{_x in thislist && _x iskindof 'SHIP'} count vehicles > 1", "hint 'trigger on'; _ammo = 'ARTY_Sh_82_HE' camCreate (getPos _trg); _mine setDamage 1; deleteVehicle _trg; deleteMarker _minemarker", ""];
    _trg attachTo [_mine,[0,0,0]];
    
    _minemarker = createMarker ['naval_mine', position _mine];
    _minemarker setMarkerShape "ICON";
    "naval_mine" setMarkerType "Warning";
    "naval_mine" setMarkerText "Naval Mine";
    This works for everything EXCEPT creating the bomb! This is the line:

    Code:
    _trg setTriggerStatements ["{_x in thislist && _x iskindof 'SHIP'} count vehicles > 1", "hint 'trigger on'; _ammo = 'ARTY_Sh_82_HE' camCreate _pos; _mine setDamage 1;
    ... where:

    "{_x in thislist && _x iskindof 'SHIP'} count vehicles > 1",
    = the condition,

    "hint 'trigger on'; _ammo = 'ARTY_Sh_82_HE' camCreate _pos; _mine setDamage 1; deleteVehicle _trg; deleteMarker _minemarker",
    = On Activation.

    All I get is the hint. Nothing else will activate. Now, when I manually create a trigger in the editor, I can make it work fine with this:

    _ammo = 'ARTY_Sh_82_HE' createVehicleLocal (position mine)
    ... and in the mine's INIT:
    Code:
    scr = this execVM "mines.sqf";

    Unfortunately it seems that the use of "_mine" is not equal to "mine" in the editor (named object). I've tried several different methods including an array with getpos select 0, getpos select 1, etc. and it complains with "type any, expected number". So what I think is happening is I'm telling it to create the object at the variable location, not at the OBJECT location. I think. So what I need to do is have the camcreate happen "at" the trigger. I'm just not sure how to do that. In the editor it is easy - the named object "mine" is the focus of the commands and it works like a charm.

    If I use "hint str(position _trg);" or "hint str(position _mine);" in the script, I get a valid location.

    So I think I'm asking how to pass an unnamed object's identity to the trigger? I expected "_mine" to have been correct since "_mine = this" (the mine object).

  9. #9
    How about trying to retrieve the trigger's 'attachedObject' in the trigger statements instead of passing the _mine in? (Haven't tested this).
    www.plannedassault.com - your web based mission generator for large scale combined arms battles

  10. #10
    I tried that and didn't get anything back. In fact it seems the only thing I'm not doing properly is passing the right information in the "on activation" part of the trigger. I had an idea last night to have the trigger exec a 2nd script, so I will try to do all the "getpos" stuff in the 2nd script by using "_this" which should be the trigger. I will try that tonight or tomorrow.

Page 1 of 2 12 LastLast

Similar Threads

  1. Question : Limit Usage of a Type of Asset/Air Unit to a certain class/type
    By farix in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 0
    Last Post: May 30 2011, 22:29
  2. AP Mine
    By _-Tiger-_ in forum ARMA : CONFIGS AND SCRIPTING (addons)
    Replies: 2
    Last Post: Jul 1 2007, 20:17
  3. Mine AT
    By fullmetal in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 7
    Last Post: Feb 23 2007, 17:02
  4. Anybody making a kylliki type soundpack?
    By [-DST-] HIGHLANDER in forum ARMA - ADDONS & MODS: DISCUSSION
    Replies: 2
    Last Post: Feb 19 2007, 22:38
  5. Anybody making a kylliki type soundpack?
    By [-DST-] HIGHLANDER in forum ARMA - GENERAL
    Replies: 1
    Last Post: Feb 19 2007, 18:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •