April 18, 2024, 18:19:56

Author Topic: Problems using cloaking device due to "no fog of war"  (Read 7418 times)

Offline Data

  • Recruit
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Problems using cloaking device due to "no fog of war"
« on: July 24, 2011, 18:42:19 »
First off all hi everybody.

@Arparso: Already knowing me out of CDV IG3-Board? *waving*

After years I rediscovered Nexus. Unfortunatelly I cannot play the Campain or the MP due to some curious crashes but missions created with arparsos Skirmisher are working...   ???

I want to use a cloaking device as in one of the campain mission were you have to infiltrate that asteroid station. My problem is, that in a skirmish mission all ships are revealed from the beginning on and when I active the cloaking the enemy will chase my ship about all distances and no matter what sensors he uses.

I tried various combinations of these detection commands "Hide" and "Unhide", and most Enable-Commands but either the ship is invisible and cannot be detected even when uncloaked after the mission started or the enemy can it detect everywere even when cloaked.

Is there a possibility to use the cloaking device as intended? The enemy should discover my ship and scan it's devices but when I active cloaking it will disappear from his sensors (off course with respect to Shiptype, Range...)

Thanks

The reports of my disassembly are greatly exaggerated.

Offline GeoModder

  • Chief Petty Officer
  • **
  • Posts: 279
  • Karma: 4
    • View Profile
    • http://
Re: Problems using cloaking device due to "no fog of war"
« Reply #1 on: July 24, 2011, 20:06:51 »
The problem here probably is that you're including the Skirmisher's battle machine. Inthere it is coded to reveal all ships and devices from the first second. You could or try to disable that part of the code or don't include it in your mission file.

Offline Data

  • Recruit
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Problems using cloaking device due to "no fog of war"
« Reply #2 on: July 24, 2011, 20:40:43 »
Thanks for your reply.

I deleted the following passage in the *ai.mach.

Quote
//for cloaking ships, we will have to change code below
               ExecList(AIFleetL1,
                  MakeFullyKnown(s.this);
                  FreezeReconState(s.this, #race_player, 1);
               );
               PlayerFleetL1:=GetFreeSel();
               SelectShips(PlayerFleetL1, s.race=#race_player);
               ExecList(PlayerFleetL1,
                  MakeFullyKnown(s.this);
                  FreezeReconState(s.this, #race_spacetech, 1);
               );
               m.PShipsCount:= AllNumOf(PlayerFleetL1);

Now cloaking seems to work fine. Any ideas if adding something else would make this work even better? I ask because the first line says "we have to change code" not "have to delete" so I have the assumption that arparso intended to enter different code for cloaking.

Furthermore, am I right that making these change in "/_templates/default_ai.mach_" will affect all future missions or is there another place i have to alter?
The reports of my disassembly are greatly exaggerated.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Problems using cloaking device due to "no fog of war"
« Reply #3 on: July 28, 2011, 19:19:52 »
You probably deleted there more than you had to, but yeah, that's what you needed to do.
the part that says "MakefullyKnown(...)" are the ones responsible for your problem, so you'd probably just have to delete those parts. this is what it should end up looking as:
Code: [Select]
//for cloaking ships, we will have to change code below
PlayerFleetL1:=GetFreeSel();
SelectShips(PlayerFleetL1, s.race=#race_player);
m.PShipsCount:= AllNumOf(PlayerFleetL1);

This, however, won't be very kind to the AI, as it's not meant to handle cloacked ships, for example, it could happen that enemy ships will just sit there and won't pursuit, even after you revealed yourself.

And yes, changes on that file will affect the rest of the missions.

Offline Data

  • Recruit
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Problems using cloaking device due to "no fog of war"
« Reply #4 on: July 29, 2011, 01:56:43 »
I tested it several times with my changes (deleted the whole part) and the AI seemed to have no problem. Chased my ship when uncloaked ---> cloaked and changed position ---> enemy reached old position ---> decloaked, enemy headed torwards me...
The reports of my disassembly are greatly exaggerated.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Problems using cloaking device due to "no fog of war"
« Reply #5 on: August 16, 2011, 15:29:21 »
Quote
@Arparso: Already knowing me out of CDV IG3-Board? *waving*
Good god, how long has that been? :D

Yeah, "fun" times back then, going through the ups and downs of Nexus' lifecycle, back when it was still called Imperium Galactica III or Galaxy Andromeda and when they finally canned the project in 2002 or 2003 or whenever that was. God, I hate CDV...

As for the actual question: yeah, you got the right code there. It would suffice to remove the MakeFullyKnown() and FreezeReconState() lines. These have indeed been put in there to "jumpstart" the battle and not having to rely on the AI discovering the player by accident or not at all. Lazy solution, I know :P

And yeah, changing the default AI template will change all future missions created with this default mission type. If you want to avoid that, copy and rename the "default_ai.mach_" and "default_obj.mach_" to something like "newdefault_ai.mach_" and "newdefault_obj.mach_": the Skirmisher will pick these up as new mission type and make it selectable in the drop down menu. You can then edit these new files to your heart's content without affecting any missions created with the default mission type.