Home   Help Search Login Register  

Author Topic: Adding a bit of Immersion help  (Read 3608 times)

0 Members and 1 Guest are viewing this topic.

Offline CharlieReddog

  • Members
  • *
Adding a bit of Immersion help
« on: 30 Jun 2009, 22:47:11 »
I'm creating an escape and evasion mission for a friend and I. I'd like to add a bit more immersion to the scenario by the following:

1) Removing the map for the players.

2) Removing any radio options.

The second I'm fairly comfortable doing, but what I'd like is when the players are near a static radio (say in an enemy camp) they should be able to use it so adding radio options when within say 2m of the radio. I'd also like them to have the option of returning to the crash site, and retrieving a radio. here's the problem, I can't seem to find a radio object which they could take possession of?

The Map based problem, again, i'd like them to be able to gain the map should they kill an enemy officer (which would have marked positions on of enemy) or from a dead crewman near the crash should they return. Again, I don't seem to be able to find a suitable object.

Additionally, showMap False doesn't seem to work at all.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Adding a bit of Immersion help
« Reply #1 on: 30 Jun 2009, 23:10:51 »
A2 has now inventory objects for both.

Offline CharlieReddog

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #2 on: 30 Jun 2009, 23:18:09 »
How can I find them, they don't appear to be listed here ->http://www.armatechsquad.com/ArmA2Class/

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #3 on: 30 Jun 2009, 23:53:01 »
The standard special items are itemMap, itemRadio, itemCompass and itemWatch, which are the objects that go into the lower region of the gear display. They are considered to be weapons, so use removeWeapon to take them away.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline CharlieReddog

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #4 on: 01 Jul 2009, 07:32:34 »
Many thanks. :clap:

Once this mission's complete I'll look to release it here.

Offline Inkompetent

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #5 on: 01 Jul 2009, 11:09:01 »
Also remember the itemGPS. I'm not sure how common it is as standard gear, but can be good to take note of :)

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Adding a bit of Immersion help
« Reply #6 on: 01 Jul 2009, 11:17:59 »
If you just want to get rid of them all (Compass, GPS, Map, Radio), just use removeAllItems on the unit.

Offline CharlieReddog

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #7 on: 03 Jul 2009, 22:38:03 »
I'm now coming to use these nuggets of info, and I want to know how to get the following to work, or along these lines.

Code: [Select]
{removeallitems _x} foreach units allgroups;
I then want to addweapon itemmap to each East/opfor group leader on say a 30% chance per leader, and the same with the radio. That way there should be some random dudes running round with a map, or a radio, or maybe both.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #8 on: 04 Jul 2009, 02:25:34 »
You can't take a list of units from allgroups, since it is an array of groups, not groups.
Code: [Select]
{
    {
        removeAllItems _x;
        if (((side _x) == east) and (_x = (leader _x))) then
        {
              if ((random 1) < 0.3) then { _x addWeapon "itemMap"; };
              if ((random 1) < 0.3) then { _x addWeapon "itemRadio"; };
        };
    } forEach (units _x);
} forEach allGroups;
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline CharlieReddog

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #9 on: 05 Jul 2009, 17:46:10 »
Thanks for that spooner. Unfortunately it doesn't work. :no:

By removing the if statements regarding the replacing of the map and radio items I can get it to work, but no joy otherwise.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #10 on: 05 Jul 2009, 18:51:26 »
Sorry, mistyped == as =:
Code: [Select]
{
    {
        removeAllItems _x;
        if (((side _x) == east) and (_x == (leader _x))) then
        {
              if ((random 1) < 0.3) then { _x addWeapon "itemMap"; };
              if ((random 1) < 0.3) then { _x addWeapon "itemRadio"; };
        };
    } forEach (units _x);
} forEach allGroups;
Have tested it now and it seems fine. Sorry, I need to get back into the habit of testing all code I post here properly, since it always leads to tears (and many OFPEC members can't debug my code effectively).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Rommel92

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #11 on: 07 Jul 2009, 06:03:41 »
Code: [Select]
{
removeAllItems _x;
if (((side _x) == east) and (_x == (leader _x))) then
{
if ((random 1) < 0.3) then { _x addWeapon "itemMap"; };
if ((random 1) < 0.3) then { _x addWeapon "itemRadio"; };
};
} forEach allUnits;

No?
« Last Edit: 07 Jul 2009, 12:41:41 by Spooner »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #12 on: 07 Jul 2009, 12:42:39 »
Oops, yes. I was under a false impression that there was an allGroups but not an allUnits (allUnits is strictly unnecessary, since you can find all units from it).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline CharlieReddog

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #13 on: 07 Jul 2009, 19:40:31 »
But would leader _x work, since it's a unit not a group being passed?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #14 on: 07 Jul 2009, 19:53:01 »
In both cases, the inner part of the loop is referring to a unit (and exactly the same units will be iterated through, although not necessarily in the same order).
Code: [Select]
{ ..._x is a unit... } forEach allUnits;
Code: [Select]
{ ...outer _x is a group...; { ...inner _x is a unit... } forEach units _x; }forEach allGroups;
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Rommel92

  • Members
  • *
Re: Adding a bit of Immersion help
« Reply #15 on: 10 Jul 2009, 07:11:52 »
Code: [Select]
{
_leader = leader _x;
{removeAllItems _x} foreach _x;
if ( (not isnull _leader) and (side _leader == east) ) then {
if ((random 1) < 0.3) then { _x addWeapon "itemMap"; };
if ((random 1) < 0.3) then { _x addWeapon "itemRadio"; };
};
} forEach allGroups;

Maybe saves processing time? Dunno. Wouldn't change it that much, but hey, efficiency is gooooooood right?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Adding a bit of Immersion help
« Reply #16 on: 10 Jul 2009, 23:54:56 »
Good point, but the problem is then that each non-leader will still have the default equipment.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)