Home   Help Search Login Register  

Author Topic: Problem using mines  (Read 768 times)

0 Members and 1 Guest are viewing this topic.

Offline Carl Gustaffa

  • Members
  • *
  • I'm a llama!
Problem using mines
« on: 01 Jan 2006, 15:33:36 »
Hi

I am playing an engineer who has some mines. I lay them down and go to an ammocrate with this code
Code: [Select]
addWeaponCargo ["Mine", 3] in its init field. I can grab one of the mines but I'm not able to put it out again. I can only drop it, the action menu "Put Mine, x left" has been deleted. My internal minecount does not increase when I grab a mine.

Any way around this?

Also, I have a trigger that doesn't trig when attempting to to count the numbers of mines within an area. The trigger check goes something like
Code: [Select]
("Mine" countType list tMineFieldCreated) > 2none activated repeatadly, and trigger name tMineFieldCreated. I've also tried anybody and west (including "this and"), but I'm not getting anywhere. I've tried different types of ammocrates too, but filling them via the snippet.

Where am I going wrong with these?

marcus3

  • Guest
Re:Problem using mines
« Reply #1 on: 01 Jan 2006, 15:41:58 »
try useing addmagazine aswell ;)

Offline Carl Gustaffa

  • Members
  • *
  • I'm a llama!
Re:Problem using mines
« Reply #2 on: 01 Jan 2006, 16:25:26 »
Doh! Yes, giving some magazines definately helped. What an oversight :p

But the counting still doesn't work though.  

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Problem using mines
« Reply #3 on: 02 Jan 2006, 01:51:17 »
Take the weapon bit out.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Carl Gustaffa

  • Members
  • *
  • I'm a llama!
Re:Problem using mines
« Reply #4 on: 02 Jan 2006, 04:34:34 »
Well, I only have the magazine stuff now, but I'm still not able to count the mines. If I put a few Abrams within the trigger area, it gets triggered on "tank", but I have had no success on "mine", "mineE", or "put" (?).

In the comref there are a lot of references to something called cfgvehicles, but I'll be dammned if I can find it :) Any ideas? I've searched files, tuts, documents, but...

I'm pretty sure (by now) I'm not supposed to countType "Mine", if mines aren't covered within a vehicle list (which I don't have, at least I don't have any entries called "tank" within the docs I do have), so; how can I count mines we've laid within a trigger area, to set my objective?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Problem using mines
« Reply #5 on: 02 Jan 2006, 05:56:57 »
"Mines" are not defined in cfgVehicles, but in cfgAmmo.

As countType is supposed to count vehicles of a certain type I'm not sure "Mines" would count (no pun intended) as a vehicle.

Maybe:

_mines = 0
"(typeof _x == ""Mine"") then _mines = _mines + 1" foreach thislist

Then you can test the variable _mines for value.

Not tested at all


Planck

« Last Edit: 02 Jan 2006, 06:12:00 by Planck »
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Problem using mines
« Reply #6 on: 02 Jan 2006, 08:45:55 »
You can't detect mines with a trigger...
The only way to detect a mine is to make a nearestObject search...

Like said a few times in the past, mines are very odd thing in OFP, they don't really exist on any level...

How you would detect your mines with a trigger is to make a script run by the "fired" eventHandler when a mine is put and have the script create for example a game logic in the same place as the mine is put and then you would count the game logics instead of trying to count the mines...

"fired" eh:
Code: [Select]
this addEventHandler ["fired",{if (_this select 2 == "Put") then {[_this select 0,_this select 4] exec "mineput.sqs"}]then, the mineput.sqs:
Code: [Select]
_engineer = _this select 0
_putType = _this select 4
_putMine = nearestObject [_engineer,_putType]

_dummy = "logic" camCreate (position _putMine)

Should work...
« Last Edit: 02 Jan 2006, 08:46:16 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.