Feature #21569

Nomad fixes/enhancements for ACE

Added by Robalo over 3 years ago. Updated over 3 years ago.

Status:Closed Start date:06/29/2011
Priority:Normal Due date:
Assignee:Robalo % Done:

100%

Category:Script
Target version:MSO v3.45
Component: Reproduced by another DH user:No
Close Reason: I am using some Mods:No
Affected Version:

Description

Contributing code to restore ruck contents, weapon on back, earplugs, glasses and RF/LD batteries.

nomad_mods_ace.zip (1.5 kB) Robalo, 06/29/2011 21:36

main.sqf (3.8 kB) friznit, 07/09/2011 11:11

tasm_co20_dfor_asr20.isladuala.7z (1.4 MB) Robalo, 07/09/2011 23:04

History

Updated by Tupolov over 3 years ago

  • Category set to Script
  • Status changed from New to In progress
  • Assignee set to Robalo
  • Target version set to MSO v4.6

Thanks Robalo.

Updated by rye over 3 years ago

Thanks a lot. Just what we needed. :)

Updated by friznit over 3 years ago

Added these to nomad/main.sqf for testing (see attached)

Earplugs work fine. sys-ruck still doesn't appear to be working though - backpack contents still disappear on respawn after death. Do I also have to make changes to core/scripts/init_player_ace.sqf?

Updated by Robalo over 3 years ago

friznit wrote:

Added these to nomad/main.sqf for testing (see attached)

Earplugs work fine. sys-ruck still doesn't appear to be working though - backpack contents still disappear on respawn after death. Do I also have to make changes to core/scripts/init_player_ace.sqf?

We're talking 2 different things. Stuff I contributed is for the Nomad module (restore state upon reconnect).
For respawn, why reinvent the wheel ? There's a nice module for that already in ACE.

Updated by friznit over 3 years ago

Fair enough. Unfortunately I can't make it work for reconnect either.

I've already got the ACE module in there, but this isn't restoing backpack contents either (on respawn in this case). Something's not quite right, and I can't see whether it's ACE, Nomad or sunspots that are causing the problem. I am I right in thinking you've got it all working no probs with MSO 3.42?

I would appreciate a copy of your mission if so, and I'll run a winmerge and check the difference to see if I can spot the problem.

Updated by Robalo over 3 years ago

friznit wrote:

I am I right in thinking you've got it all working no probs with MSO 3.42?

I would appreciate a copy of your mission if so, and I'll run a winmerge and check the difference to see if I can spot the problem.

Sure.

Updated by friznit over 3 years ago

Found it and fixed it, many thanks. Had to also comment out the respawn handling part of init_player.sqf (as you say, no point reinventing the wheel, let the ACE module do the work) and remove the if(!isNil "ace_main") then {} para from nomad\main.sqf Works a treat, both on respawn and reconnect.

Very nice mission by the way, those side missions are a nice touch.

Edit: more details of the exact steps so Wolffy can recreate if needed. This is a 'hard' fix and removes the ACE detection stuff because that didn't appear to be working as intended.

Nomad:

1. Copy Robalo's nomad mods to ..\core\modules\nomad\mods
2. In core\modules\nomad\main.sqf, add all 5 mods (#include <mods\ace_earplugs_g.hpp> etc) to the first array at Ln 28
3. Deleted Lines 30-35 (*[if(!isNil "ace_main" etc etc]) cos it didn't appear to be working as intended

Respawn handling:

1. core\scripts\init)player.sqf, comment out or delete Lines 19-48 (i.e. remove all the equipment handling stuff as this is handled by the ACE module)
2. Add ACE_SYS_PRespawn_Logic to in the map editor (module to respawn with weapons).

Also works with kit in ACRE radios.

Many thanks Robalo!

Updated by Robalo over 3 years ago

A reliable check for detecting if ACE is on:

isClass(configFile>>"CfgPatches">>"ace_main")

Returns boolean true or false.

Updated by friznit over 3 years ago

Ah, very cool. So we could change Lines 31 (and similar at Ln 122) for the ACE mods array in \nomad\main.sqf to
[
if (isClass(configFile>>"CfgPatches">>"ace_main")) then {
#include <mods\ace_sys_ruck_g.hpp>
#include <mods\ace_sys_wounds_g.hpp>
etc
etc
}
],

Can also go in scripts/init_player.sqf and we can remove the init_player_Ace.sqf altogether and let the ACE respawn with weps module do the work.

Updated by wolffy.au over 3 years ago

  • Status changed from In progress to Closed
  • % Done changed from 0 to 100

Updated by Tupolov over 3 years ago

  • Target version changed from MSO v4.6 to MSO v3.45

Updated by Tupolov over 3 years ago

  • Status changed from Closed to Feedback

Updated by Tupolov over 3 years ago

Friznit reported this still was not working.

Updated by Robalo over 3 years ago

If it's the ruck feature, the code that I sent for it was not implemented. See the ace_sys_ruck_*.hpp files.

Updated by friznit over 3 years ago

The code Robalo submitted works fine. It's the ACE check that we're trying to implement in nomad/main.sqf in order to make the file as generic as possible that doesn't appear to be working (so we don't have a completely different set of code for ACE and non ACE versions)


[...stuff...
] + [
if (isClass(configFile>>"CfgPatches">>"ace_main")) then {
#include <mods\ace_sys_ruck_g.hpp>
#include <mods\ace_sys_wounds_g.hpp>
etc
etc
}
],

If I put all the #include <mods> in the first array, it works fine. Question, would this have an impact on vanilla versions if left there?

Updated by Robalo over 3 years ago

I see, that doesn't look right to me. Perhaps a simple solution would be to have a

#define ACE
in description.ext
then this code:
] + [
      if (isClass(configFile>>"CfgPatches">>"ace_main")) then {
         #include <mods\ace_sys_ruck_g.hpp>
         #include <mods\ace_sys_wounds_g.hpp>
         #include <mods\ace_earplugs_g.hpp>
         #include <mods\ace_glasses_g.hpp>
         #include <mods\ace_rangefinder_g.hpp>
      }
],

could be corrected like this:
#ifdef ACE
#include <mods\ace_sys_ruck_g.hpp>
#include <mods\ace_sys_wounds_g.hpp>
#include <mods\ace_earplugs_g.hpp>
#include <mods\ace_glasses_g.hpp>
#include <mods\ace_rangefinder_g.hpp>
#endif
],

Updated by Tupolov over 3 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF