Nexus Skirmisher

Nexus Modding => Scripting => Topic started by: The_Small_Time_Modder on September 22, 2011, 02:29:37

Title: The AI and You
Post by: The_Small_Time_Modder on September 22, 2011, 02:29:37
I had a few questions on scripting the AI.

1. Can you set it so the AI activates when any ship you have enters a certain area in the scene?

2. How do you code for a fleet to enter the scene via jump?

And a question out of curiosity....

3. Could it be possible to create a program sort of like the trigger/condition/event programs found in editors of games, such as AOE 3, that can be used to easily create code for an AI? if so that could be a really neat tool. If not it was just an idea.  :-\
Title: Re: The AI and You
Post by: Mularac on September 22, 2011, 09:28:22
1- That can easily be done. Just create the areas and then use the AreaEntered event.
For example, let's have a look at this piece of code, using my default_AI as basis:

Code: [Select]
MACHINE "AI"
STATE Start
RULE event in
:action
SetAreaAbs(0, <x>, <y>, <z>, <radius>);
SetAreaAbs(1, <x>, <y>, <z>, <radius>);
SetAreaAbs(2, <x>, <y>, <z>, <radius>);
SetAreaAbs(3, <x>, <y>, <z>, <radius>);
//We declare here the areas in the scene.
:end
END

//For example, we want to boot the ai when one of the players ships reach the 2 area
RULE event AreaEntered
condition e.ship:race=#race_player&e.area=2
:action
M:GetMachine("InnerAI"):ChangeState(Battle,
e.ownMachine := M:GetMachine("InnerAI");
e.oRace := #race_gorg;
e.oRaceList := -1;
e.oShipList := -1;
e.eRace := #race_player;
e.eRaceList := -1;
e.eShipList := -1;
e.parentMachine := M:GetMachine("AI");
);
//Simple declaration of the AI, this will make the gorg ships launch towards the player ships.
:end
END
END
END


MACHINE "InnerAI"
#include "defaultAI.mach"
END

2- You mean ip jump or gate jump?

3- I don't think I follow.... you mean like a more user-friendly IDE?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 22, 2011, 21:39:10
 2- More like an IP jump, sorry i didnt clarify that!  :(

 3- i think so, im talking about how some editors allow you to create triggers, then create conditions (what sets off the trigger) and events (the result of the trigger) to make an in-depth mission, i have quite a bit of experience with that such system thanks to the editor from starcraft II (excellent editor in my opinion, i figured it all out in less than two days!)

Edit: on a side note, would you put that coding IN the default_ai.mach? or make it a seperate .mach? i just dont want to wind up doing the wrong thing and end up stumped again. I hate it when i wind up like that. >:(

Edit #2: If you can make the program i was talking about earlier, that would be a true honor! i think you're an absolute genius with coding this stuff! :D

That includes Aparso, if you're reading this Aparso... YOU'RE AWESOME! :D
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 00:29:32
well... it COULD be done. But it'd mean a shitload of work... probably too much. Not a priority right now, actually...
Working with a single text file is simple enough, once you get used to it and find a proper environment to ease up on the things (I recommend notepad++)

About the other thing: yeah, this code is meant to go someplace else, a .mach file or inside the .mission one. Just take care that the path to the default_ai.mach file in the #include line is the correct one (that file is located on this forum. somewhere)

and the ip drive arrival:

first, select the ships to jump (for example, all the player ships), then go through the list applying the longRangeArrive(ship) command to each item of the list:
Code: [Select]
e.shipsToJump := getFreeSel();
SelectShips(e.shipsToJump, s.race = #race_player);
Execlist(e.shipsToJump,
longrangearrive(s.this);
);

Or you could issue that command to a ship in particular, for example, m.ship:
Code: [Select]
LongRangeArrive(m.ship);
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 00:35:16
Okie dokie, Thanks!

just a few more questions...

1. How would you code capturing a idle ship? (i.e. a battleship thats just floating around doing nothing, i tried this myself and fouled up...)

2. would you create a list for a specific group of ships to have the code you just stated affect it?

Edit: for #2, i have a group of raptor ships i specifically wanted to have jump in once the raptor ships that are present in the first place are destroyed, if that narrows your answer down...
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 03:20:47
1- if the ship has been wrecked, then no, it can't be done.

2- Creating a list is only one way. You can issue the command to an individual ship, from wherever you got that ship's identifier, but I found myself using lists and selections 90% of the time.

Edit for 2:
Yeah, that's very easy to do.
first, you need to store the ships that are to jump on a list, because I'm guessing that until they are called they'll remain dissaperead, right? (disappeared ships can't be selected)

So add this line in your sceneInit rule:

Code: [Select]
raptors := GetFreeSel();
selectShips(raptors, s.race = #race_raptor (or whatever race they are));

Then disappear the ships that you know will appear as reinforcements later on.

Then, keep an eye out for the event that all raptor ships have been taken out:

Code: [Select]
Rule Event FatalDamaged
condition e.ship:race=#race_raptor
:action
e.count := selectShips(0, s.race=#race_raptor);
if(e.count = 0,
m:Execlist(m.raptors, longRangeArrive(s.this)); //The M:execlist goes because the list raptors is stored in the mission block, and as such can only be accesed that way.
);
:end
END
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 03:37:34
Is it the same for a dynamic group? i put the ships in a dynamic group instead of having them dissappear in the coding. Or is it even possible with a dynamic group?  ???
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 04:18:29
What do you mean a dynamic group?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 04:30:14
In the editor you can have a group of ships/objects become a dynamic group, it says so right in the modding manual...
i can even give you the page # and section.

Pg. 56  section 7.2.8

the result is that the objects dissappear from the game unless (i assume) called for by an event from the scripts.
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 06:03:11
oh yeah... the mystic dynamic block. I've been modding this game for about... 4 years now? and I still don't how the heck to work with that :P
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 06:30:29
Laugh out loud... XD

Hey, i just tested the 'Area activates AI' coding you provided for me earlier.

MACHINE "INNER_AI"
   STATE Start
      RULE event in
         :action
            SetAreaAbs(0, <-4000> , <-1000> , <-500> , <2250>);
            //We declare here the areas in the scene.
         :end
      END

   //For example, we want to boot the ai when one of the players ships reach the 0 area
   RULE event AreaEntered
      condition e.ship:race=#race_player&e.area=0
         :action
            M:GetMachine("INNER_AI"):ChangeState(Battle,
                                       e.ownMachine := M:GetMachine("INNER_AI");
                                       e.oRace := #race_raptor;
                                       e.oRaceList := -1;
                                       e.oShipList := -1;
                                       e.eRace := #race_player;
                                       e.eRaceList := -1;
                                       e.eShipList := -1;
                                       e.parentMachine := M:GetMachine("AI");
                                    );
            //Simple declaration of the AI, this will make the raptor ships launch towards the player ships.
         :end
      END
   END
END


MACHINE "INNER_AI"
#include "default_ai.mach"
END

For some reason my finiky copy thinks what i put in red for you doesn't exist, what i put in lime green is what i predict it also thinks doesnt exist, any ideas?

Edit: The battleship i tried to code to be capturable wasnt a wreck, it was simply sitting there, like a sleeping duck, if you want to call it that ;)
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 17:33:55
Couple of things: you have two machines that are named the same, check that.
Also, you wrote this:

SetAreaAbs(0, <-4000> , <-1000> , <-500> , <2250>);

I put the "<,>" in my example to say what you were supposed to put in them, they don't have to be there!
It should be like this:
SetAreaAbs(0, -4000 , -1000, -500 , 2250);

The "<,>" are comparators, for example, putting 2>3 will return 0, and 4<8 will return 1. They are used in conditions and ifs
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 19:29:17
OH....

whoops!  ::)

my bad, i guess i shouldnt have put them there in the first place.

Ill take 'em off and try again, thanks for clearing that up man.  ;)

Edit: ok, thats been fixed, i also fixed the #include code (i didnt specify for which mission's AI i wanted to include, easy fix). But now its saying that the 11_default_ai.mach has an invalid keyword, and of all of the things it picked, it picked the very first word MACHINE. I hate how it somehow comes up with random errors like that. >:(

Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 19:55:32
Can you give us some context?
where in the .mission file did you include the 11_default_ai.mach file? can you give us a short description of where each file is located and the contents of each?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 23, 2011, 22:01:01
Sure Mularac...

heres the top section of the .mission file....

MISSION 11
Name "The Atlantis"
DefLocation "ASTFLD_ARCTURUS IID" ((this is part of a custom system i made, one of three, the other two are Ouroboros and Nexor, after the games name, Nexus  ;) ))

OBJECTIVES
   1
   2
END

RULES

   RULE    event sceneInit
         :action
            SetSceneRadius(100000);      
      
            SetRelation(#race_player, #race_raptor, 2);
            SetRelation(#race_raptor, #race_player, 2);
            
            PShip.0 := GetSceneObj("Darkstar");
            PShip.1 := GetSceneObj("Vanguard");
            PShip.2 := GetSceneObj("Eringuard");
            PShip.3 := GetSceneObj("Kings Arch");

            EShip.0 := GetSceneObj("Highlander");
            EShip.1 := GetSceneObj("Skirmisher");
            EShip.2 := GetSceneObj("Stingray");
            EShip.3 := GetSceneObj("Hellstorm");
            
            Playmusic(21);
            
            GetMachine("Director"):ChangeState(IntroMovie, 0);
            GetMachine("Objectives"):ChangeState(monitor,0);
            GetMachine("AI"):ChangeState(battle,0);
            GetMachine("ATLANTIS_AI"):ChangeState(idle,0);
         :end
   END

   MACHINE "Director"

      STATE IntroMovie

         RULE   event In
               :action
               :end
         END
      END
   END
   
   #include "11_default_obj.mach"
   #include "11_default_ai.mach"      
   #include "11_atlantis_ai.mach"
   #include "11_inner_ai.mach"
                        
END

I let the explorer (the program used to look into files on your computer) order them all alphebetically in the missions file of the Skirmisher SP settings, here it is in a list... (exactly as it is in the folder)

11_atlantis_ai.mach (this AI controls the single vardrag explorer in the scene)
11_default_obj.mach (this is what the Skirmisher put in)
11_inner_ai.mach (The area activated AI that you suggested)
11_The Atlantis.mission (the file partly shown above)

Does that help you?  ???
Title: Re: The AI and You
Post by: Mularac on September 23, 2011, 23:24:01
What is the content of these files: "11_default_ai.mach" and "default_ai.mach"?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 24, 2011, 03:45:23
1-The contents of the 11_Default_AI.mach is exactly as the Nexus Skirmisher program made it, i havent even TOUCHED it.

2-Do you mean the Inner AI you talked about?  ???

Title: Re: The AI and You
Post by: Mularac on September 24, 2011, 03:50:42
I'm trying to figure out your error... If you could post more information about it it would be great. But my money is in the fact that you've named two machines the same. Check you don't have an other Machine named "AI" other than in the 11_default_AI.mach file
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 24, 2011, 03:52:55
oddly enough i dont...   ???

Do you think i could simply debug it?  :-\

Edit: maybe this can help, this is the Error, word for word...

----------------------------------------------------------------

MISSION_EDITOR_DX9 INPUT ERROR

File: universe\mod_missions\11_default_ai.mach
Line: 1

>>>MACHINE<<< "AI"

(Press OK to quit)

Description: Invalid Keyword

-----------------------------------------------------------------

Again, i havent even TOUCHED the default_ai.mach for the mission, and i gave a seperate name to the inner_ai.mach ("INNER_AI")
Title: Re: The AI and You
Post by: Mularac on September 24, 2011, 05:01:32
You probably put an end where you weren't supposed to, or forgot to put one where it was supposed to be :P
What's the content of the "11_default_obj.mach" file? I think the error is in that file.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 24, 2011, 19:02:37
heres the file your asking for.

Code: [Select]
//Basic objective structure:
//mission terminates, if either one of the two sides has no ships left

MACHINE "Objectives"

//main STATE
//majority of code is executed here
STATE monitor
RULE event In
:action
//OBJECTIVE INITIALISATION

//make sure, that both objectives are counted as "primary objectives"
SetObjectivePrimary(1, 1);
SetObjectivePrimary(2, 1);

//make sure, that both objectives are counted as "uncompleted"
MissionObjective(1,#OBJECTIVE_UNCOMPLETED);
MissionObjective(2,#OBJECTIVE_UNCOMPLETED);
:end
END

//the even FatalDamaged gets executed every time, a ship is being evacuated or even destroyed
RULE event FatalDamaged
//it is only executed, if the FatalDamaged ship is a player ship
condition E.ship:race=#race_player
:action
//Selects all player ships
SelectShips(1, s.race=#race_player);

//IF there are no player ships left
//THEN change STATE to Mission_failed
If(AllNumOf(1)=0, ChangeState(Mission_failed,0));
:end
END

//the even FatalDamaged gets executed every time, a ship is being evacuated or even destroyed
RULE event FatalDamaged
//it is only executed, if the FatalDamaged ship is an enemy ship
condition E.ship:race=#race_raptor
:action
//Selects all enemy ships
SelectShips(2, s.race=#race_raptor);

//IF there are no enemy ships left
//THEN change STATE to Mission_won
If(AllNumOf(2)=0, ChangeState(Mission_won,0));
:end
END

END //STATE monitor

STATE Mission_failed

RULE event In
:action
//Show a "Mission_lost" title
Title(0,0,0,"Mission_lost");

//Set both objectives to "failed"
MissionObjective(1, #OBJECTIVE_FAILED);
MissionObjective(2, #OBJECTIVE_FAILED);

//wait 10 seconds before quitting the mission
Delay(0,10,uQuitMission(0),0);
:end
END

END //STATE Mission_failed

STATE Mission_won

RULE event In
:action
//Show a "Mission_won" title
Title(0,0,0,"Mission_won");

//Set both objectives to "completed"
MissionObjective(1, #OBJECTIVE_COMPLETED);
MissionObjective(2, #OBJECTIVE_COMPLETED);

//wait 10 seconds before quitting the mission
Delay(0,10,uQuitMission(1),0);
:end
END

END //STATE Mission_won

END //MACHINE "Objectives"

I hope im giving you the information thats helping you out man. I also appreciate you taking time to reply to my posts on here, for which i applaud you.  :D

EDIT: i also want to say i havent touched this file either, though i plan to soon, again with your assistance, if able... ;)
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 24, 2011, 19:09:45
OH WAIT A SECOND....  :o

When you were talking about this...

Quote
Couple of things: you have two machines that are named the same, check that.

did you mean this part? if so i didnt change that!  :o

Code: [Select]
MACHINE "INNER_AI"
#include "default_ai.mach"
END

That may be the problem right there!  :D
Title: Re: The AI and You
Post by: Mularac on September 24, 2011, 19:23:25
Try changing the name of that machine to something else.
And if that doesn't work, I'm gonna have to see the content of the default_ai.mach file.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 25, 2011, 04:57:39
Do you have any suggestions/reccomendations as to what i should name it? Im thinking SECONDARY_AI...
Title: Re: The AI and You
Post by: Mularac on September 25, 2011, 05:12:43
I would leave that as Inner_AI (as it is, in fact, an inner ai) and name the upper one to MAIN_AI or RAPTOR_AI
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 25, 2011, 05:16:36
Okie dokie, thanks for the suggestion!
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 25, 2011, 22:19:29
Well... the problem is STILL persisting, blasted little...  >:(

Before you ask for the default_ai.mach, i have no clue what file exactly your talking about. do you mean from OTHER missions i have? or the 11_default_ai.mach?  ???

Sorry i seem to be as stumped as... well... a stump... but i get easily mixed up over things... you can thank the four letter noun 'ADHD' for that...  :P
Title: Re: The AI and You
Post by: Mularac on September 26, 2011, 00:03:08
you wrote this:

MACHINE "INNER_AI"
   STATE Start
      RULE event in
         :action
            SetAreaAbs(0, <-4000> , <-1000> , <-500> , <2250>);
            //We declare here the areas in the scene.
         :end
      END

   //For example, we want to boot the ai when one of the players ships reach the 0 area
   RULE event AreaEntered
      condition e.ship:race=#race_player&e.area=0
         :action
            M:GetMachine("INNER_AI"):ChangeState(Battle,
                                       e.ownMachine := M:GetMachine("INNER_AI");
                                       e.oRace := #race_raptor;
                                       e.oRaceList := -1;
                                       e.oShipList := -1;
                                       e.eRace := #race_player;
                                       e.eRaceList := -1;
                                       e.eShipList := -1;
                                       e.parentMachine := M:GetMachine("AI");
                                    );
            //Simple declaration of the AI, this will make the raptor ships launch towards the player ships.
         :end
      END
   END
END


MACHINE "INNER_AI"
#include "default_ai.mach"
END

I meant that "default_ai.mach" file, the one you've included there.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 00:26:10
OH that one!

I re-labeled it...  :-X

heres what i put:

MACHINE "INNER_AI"
#include "11_default_ai.mach"
END

Should i have done that?  ???
Title: Re: The AI and You
Post by: Mularac on September 26, 2011, 00:27:53
wait.... in the file named 11_default_ai.mach there is a line including the file 11_default_ai.mach???
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 02:33:48
Quote
wait.... in the file named 11_default_ai.mach there is a line including the file 11_default_ai.mach???

Do you mean the MAIN_AI for the second file? or the INNER_AI? that sounds so weird that you have to script to include the 11_default_ai.mach in the 11_default_ai.mach...  ???
Title: Re: The AI and You
Post by: Mularac on September 26, 2011, 03:08:06
No, you don't. That will certainly crash the game.

Please post here the contents of the file 11_default_ai.mach, the one you included in the Machine "INNER_AI"
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 21:37:06
Ok, so to sum it up, you basically include the AI that the skirmisher generated in the INNER_AI. Right?

anyway, i can't cram it in all at once, so ill give it to you in chunks, heres the first chunk.

Code: [Select]
MACHINE "AI"
STATE battle
RULE event In
:action
AIFleetL1:=GetFreeSel();
SelectShips(AIFleetL1, s.race=#race_raptor);
if(AllNumOf(AIFleetL1)>0, m.AITeam_leader:=PickMax(AIFleetL1, 1 / s.this:tGetMaxVelocity()), ChangeState(noTeam1,0)); //slowest ship is AI leader
//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_raptor, 1);
);
m.PShipsCount:= AllNumOf(PlayerFleetL1);
//time to turn on defence systems in order of importance
ExecList(AIFleetL1,
EnergyLeft:=s.this:availSuppForDevices;
TempEcmL := GetFreeSel();
TempEccmL := GetFreeSel();
TempCloakL := GetFreeSel();
TempSensorL := GetFreeSel();
If(SelectDevices(TempEcmL, s.this, s.working & InSet(s.this, 16)), //ecm
Ecm:=PickFirst(TempEcmL);
If(EnergyLeft>=Ecm:energyIn,
ActivateDevice(Ecm, 1);
EnergyLeft:=EnergyLeft-Ecm:energyIn;
);
);
If(SelectDevices(TempEccmL, s.this, s.working & InSet(s.this, 17)), //eccm
Eccm:=PickFirst(TempEccmL);
If(EnergyLeft>=Eccm:energyIn,
ActivateDevice(Eccm, 1);
EnergyLeft:=EnergyLeft-Eccm:energyIn;
);
);
If(SelectDevices(TempCloakL, s.this, s.working & InSet(s.this, 9)), //cloaking also give some protection
Cloak:=PickFirst(TempCloakL);
If(EnergyLeft>=Cloak:energyIn,
ActivateDevice(Cloak, 1);
EnergyLeft:=EnergyLeft-Cloak:energyIn;
);
);
//If(SelectDevices(TempSensorL, s.this, s.working & InSet(s.this, 18)), //sensor, need for cloakers
// Sensor:=PickFirst(TempSensorL);
// If(EnergyLeft>=Sensor:energyIn,
// ActivateDevice(Sensor, 1);
// EnergyLeft:=EnergyLeft-Sensor:energyIn;
// );
//);
DeleteSelect(TempEcmL);
DeleteSelect(TempEccmL);
DeleteSelect(TempCloakL);
DeleteSelect(TempSensorL);
);
m.AITeam_leader:tRequestShipInRangeEvent(3,3);  //to know when we are close enough to call realBattle state
DeleteSelect(AIFleetL1);
DeleteSelect(PlayerFleetL1);
Delay(0,2,LocalEvent(GetClosestTarget),0);
:end
END
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 21:38:45
And heres the second chunk....

Code: [Select]
RULE event GetClosestTarget
condition isValid(m.AITeam_leader)&not(m.AITeam_leader:wreck)
:action
Debug("GetClosestTarget");
PlayerFleetL2:=GetFreeSel();
SelectShips(PlayerFleetL2, s.race=#race_player);
if(AllNumOf(PlayerFleetL2)>0, TempMainTarget:=PickMax(PlayerFleetL2, 1 / distance(s.this, m.AITeam_leader)), ChangeState(noTeam0,0));
if(m.mainTarget!=TempMainTarget, // to avoid cpu overhead becouse of tick
Debug("New target");
m.mainTarget:=TempMainTarget;
LocalEvent(EvaluateAIFleet);
LocalEvent(FireMissile);
LocalEvent(MoveInFormation);
);
DeleteSelect(PlayerFleetL2);
:end
END

RULE event EvaluateAIFleet //evaluate AI fleet missile capabilities
name "evaluateAI"
:action
Debug("EvaluateAIFleet");
Disable("evaluateAI"); //We call it only once
AIFleetL3:=GetFreeSel();
SelectShips(AIFleetL3, s.race=#race_raptor);
MissCap:=0;
ExecList(AIFleetL3,
AIMissileDL:=GetFreeSel();
SelectDevices(AIMissileDL, s.this, s.weapon & s.working & InSet(s.this, 5) & s.count>1);
MissCap := MissCap + AllNumOf(AIMissileDL);
DeleteSelect(AIMissileDL);
);
if((MissCap/(m.PShipsCount+1))>0.4,
LocalEvent(SendAIBombers,e.cover:=1); //with enough missiles, we send in fighters early to saturate enemy flak, leaving only 1 squad for anti-missile defence
,
LocalEvent(SendAIBombers,e.cover:=10); //else we leave all fighters on defence
);
DeleteSelect(AIFleetL3);
:end
END

RULE event MoveInFormation
:action
if(IsValid(m.AITeam_leader)&Not(m.AITeam_leader:wreck)&IsValid(m.mainTarget)&Not(m.mainTarget:wreck),
AIFleetL4 := GetFreeSel();
SelectShips(AIFleetL4, s.race=#race_raptor);
//RemoveItem(AIFleetL4, m.AITeam_leader); //formation works worse then simple move
//if(NumOf(AIFleetL4)>0,
// m.AITeam_leader:tSetFormation(2, 1);
// ExecList(AIFleetL4,
// S.this:tSetForbid(#FORBID_MOTION_MOTIVATION_AWAY);
// S.this:tFollow(m.AITeam_leader, 2000, 10);
// );
//);
ExecList(AIFleetL4,
s.this:tSetForbid(#FORBID_MOTION_MOTIVATION_AWAY);
SetAbsSpeed(s.this, m.AITeam_leader:tGetMaxVelocity());
s.this:tMoveTo(m.mainTarget, 2, 0);
);
DeleteSelect(AIFleetL4);
,
LocalEvent(FatalDamaged);
);
:end
END

RULE event FireMissile
:action
Debug("FireMissile");
if(isValid(m.AITeam_leader)&Not(m.AITeam_leader:wreck)&IsValid(m.mainTarget)&Not(m.mainTarget:wreck),
AIFleetL5:=GetFreeSel();
SelectShips(AIFleetL5, s.race=#race_raptor);
ExecList(AIFleetL5,
s.this:tClearFire;
s.this:tSetForbid(#FORBID_FIRE_MISSILE);  //we don't want AI to mess with it
AIMissileL:=GetFreeSel();
SelectDevices(AIMissileL, s.this, s.weapon & s.working & InSet(s.this, 5) & s.count!=0); //missiles & e-bombs
ExecList(AIMissileL,
s.this:contFire:=1; //burst missile fire
ActivateDevice(S.this, 1);
TargetWeapon(S.this, m.mainTarget);
);
DeleteSelect(AIMissileL);
);
DeleteSelect(AIFleetL5);
,
LocalEvent(FatalDamaged);
);
:end
END

Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 21:42:04
The third chunk....

Code: [Select]
RULE event SendAIBombers
:action
Debug("Send Bombers");
PlayerFleetL6:=GetFreeSel();
SelectShips(PlayerFleetL6, s.race=#race_player);
ExecList(PlayerFleetL6,
WGDevL:=GetFreeSel();
SelectDevices(WGDevL, s.this, s.this:damage<100&InSet(S.this, 70));  //focusing on weapon generators
if(isValid(PickFirst(WGDevL)), FocusDevice(PickFirst(WGDevL), #race_raptor, 1));
DeleteSelect(WGDevL);
);
DeleteSelect(PlayerFleetL6);
AIFleetL6:=GetFreeSel();
SelectShips(AIFleetL6, s.race=#race_raptor);
ExecList(AIFleetL6,
s.this:tSetForbid(#FORBID_FIRE_BOMBER);   //we don't want AI to mess with it as well
AIBombersL:=GetFreeSel();
HostShip:=s.this;
NumofCover:=0;
SelectDevices(AIBombersL, s.this, s.weapon&s.working&s.count!=0&InSet(s.this,22));  //fighters by SET
ExecList(AIBombersL,
ActivateDevice(s.this, 1);
if(NumofCover<e.cover,
NumofCover:=NumofCover+1;
WeaponMode(s.this,3,HostShip);
,
WeaponMode(S.this,5,m.mainTarget);
);
);
SelectDevices(AIBombersL, s.this, s.weapon&s.working&s.count!=0&InSet(s.this,20));  //then gunboats by SET
ExecList(AIBombersL,
ActivateDevice(s.this, 1);
if(NumofCover<e.cover,
NumofCover:=NumofCover+1;
WeaponMode(s.this,3,HostShip);
,
WeaponMode(S.this,5,m.mainTarget);
);
);
SelectDevices(AIBombersL, s.this, s.weapon&s.working&s.count!=0&InSet(s.this,21));  //then bombers by SET
ExecList(AIBombersL,
ActivateDevice(s.this, 1);
if(NumofCover<e.cover,
NumofCover:=NumofCover+1;
WeaponMode(s.this,3,HostShip);
,
WeaponMode(S.this,5,m.mainTarget);
);
);
);
DeleteSelect(AIFleetL6);
:end
END

RULE event Tick
:action
// basic energy management
Debug("tick battle");
AIFleetL7:=GetFreeSel();
SelectShips(AIFleetL7, s.race=#race_raptor);
ExecList(AIFleetL7,
if(s.this:reserveLevel>25,  //full power to weapons, however we leave reserve for shield augmenting
s.this:tEnergyMode(1, 2);
,
s.this:tEnergyMode(1, 0);
);
);
DeleteSelect(AIFleetL7);
LocalEvent(GetClosestTarget); //during battle we constantly update closest target
:end
END
Tick 6

RULE event CO_ShipInRange
:action
Debug("In range");
ChangeState(realBattle,0) //time to close in action
:end
END

RULE event FatalDamaged
:action
Debug("battleFatalDamaged");
if(e.ship:Race=#race_player,
m.PShipsCount:=m.PShipsCount-1;
if(e.ship=m.mainTarget,
LocalEvent(GetClosestTarget);
);
,
if(e.ship=m.AITeam_leader,
AIFleetL8:=GetFreeSel();
SelectShips(AIFleetL8, s.race=#race_raptor);
if(AllNumOf(AIFleetL8)>0, m.AITeam_leader:=PickMax(AIFleetL8, 1 / s.this:tGetMaxVelocity()), ChangeState(noTeam1,0));
DeleteSelect(AIFleetL8);
//LocalEvent(MoveInFormation);
LocalEvent(GetClosestTarget);
);
);
:end
END

RULE event out //disband formation
:action
if(isValid(m.AITeam_leader)&Not(m.AITeam_leader:wreck)&IsValid(m.mainTarget)&Not(m.mainTarget:wreck),
AIFleetL9 := GetFreeSel();
SelectShips(AIFleetL9, s.race=#race_raptor);
ExecList(AIFleetL9,
SetAbsSpeed(s.this, s.this:tGetMaxVelocity());
s.this:tMoveTo(m.mainTarget, 2, 0);
);
DeleteSelect(AIFleetL9);
);
:end
END

END //STATE battle

STATE realBattle

RULE event In
:action
Disable("latertick");
//just precaution if something changed during switching states
if(Not(isValid(m.AITeam_leader))|m.AITeam_leader:wreck,
AIFleetL1:=GetFreeSel();
SelectShips(AIFleetL1, s.race=#race_raptor);
if(AllNumOf(AIFleetL1)>0, m.AITeam_leader:=PickMax(AIFleetL1, 1 / s.this:tGetMaxVelocity()), ChangeState(noTeam1,0)); //slowest ship is AI leader
DeleteSelect(AIFleetL1);
);
if(not(IsValid(m.mainTarget))|m.mainTarget:wreck,
PlayerFleetL1:=GetFreeSel();
SelectShips(PlayerFleetL1, s.race=#race_player);
if(AllNumOf(PlayerFleetL1)>0, m.mainTarget:=PickMax(PlayerFleetL1, 1 / distance(s.this, m.AITeam_leader)), ChangeState(noTeam0,0));
DeleteSelect(PlayerFleetL1);
);

m.AITeam_leader:tRequestShipInRangeEvent(2,3);  //to know when we are close enough to enable deflection and combat engines
Delay(0,1,LocalEvent(EvaluateAIFleet),0);
Delay(0,2,LocalEvent(GetMainTarget),0);
Delay(0,4,LocalEvent(GetSecondaryTarget),0);
Delay(0,6,LocalEvent(GetMissileTarget),0);
Delay(0,8,Enable("latertick"),0);
:end
END

RULE event EvaluateAIFleet
:action
AIFleetL2:=GetFreeSel();
SelectShips(AIFleetL2, s.race=#race_raptor);
AIShipSHBusterL:=GetFreeSel(); //shield and hull buster ships
AIShipDeviceBusterL:=GetFreeSel(); //device buster ships
ExecList(AIFleetL2,
AIDevBustDL:=GetFreeSel();
AISHBustDL:=GetFreeSel();
SelectDevices(AIDevBustDL, s.this, s.weapon & s.working & s.deviceValue=1 & s.count!=0);
SelectDevices(AISHBustDL, s.this, s.weapon & s.working & (s.hullValue=1 | s.shieldValue=1) & s.count!=0);
SubList(AIDevBustDL, AISHBustDL); // remove multipurpose weapons
if(NumOf(AIDevBustDL)>NumOf(AISHBustDL),
AddItem(AIShipDeviceBusterL, s.this); // ships with primary device busting capablities
,
AddItem(AIShipSHBusterL, s.this); // ships with primary hull and shield busting capablities
);
//DeleteSelect(AIMissileDL);
DeleteSelect(AIDevBustDL);
DeleteSelect(AISHBustDL);
);
DeleteSelect(AIFleetL2);
LocalEvent(FocusOnDevices);
:end
END
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 21:43:15
The fourth chunk (hope im not overwhelming you)

Code: [Select]
RULE event Tick
Name "latertick"
:action
// basic energy management
Debug("realBattle tick");
AIFleetL3:=GetFreeSel();
SelectShips(AIFleetL3, s.race=#race_raptor);
ExecList(AIFleetL3,
if(s.this:reserveLevel>25,  //full power to weapons, hovever we leave reserve for shield augmenting
s.this:tEnergyMode(1, 2);
,
s.this:tEnergyMode(1, 0);
);
if(s.this:shieldLevel<50, //boost shield when low
s.this:tEnergyMode(2, 2);
,
s.this:tEnergyMode(2, 0);
);
);
if(isValid(m.AITeam_leader)&isValid(m.mainTarget)&not(m.mainTarget:wreck)&not(m.AITeam_leader:wreck),
if(range(m.AITeam_leader,m.mainTarget)>3, //main target running away
LocalEvent(GetMainTarget);
);
);
if(isValid(m.secondaryTarget)&isValid(m.mainTarget)&not(m.mainTarget:wreck)&not(m.secondaryTarget:wreck),
if(range(m.secondaryTarget,m.mainTarget)>3, //secondary target running away
LocalEvent(GetSecondaryTarget);
);
);
if(isValid(m.missileTarget)&not(m.missileTarget:wreck),
InBlastRange:=0;
AIFleetL4:=GetFreeSel();
SelectShips(AIFleetL4, s.race=#race_raptor);
ExecList(AIFleetL4,
if(range(m.missileTarget,s.this)=2,
InBlastRange:=1;
);
);
DeleteSelect(AIFleetL4);
if(InBlastRange,LocalEvent(GetSecondaryTarget));  //some of our ships are in blast range - retargeting missiles
);
DeleteSelect(AIFleetL3);
:end
END
Tick 6

RULE event CO_ShipInRange
:action
Debug("In range");
AIFleetL5:=GetFreeSel();
SelectShips(AIFleetL5, s.race=#race_raptor);
ExecList(AIFleetL5,
EnableDodge(s.this, 1);
s.this:tEngineMode(2);
);
DeleteSelect(AIFleetL5);
:end
END

RULE event CO_DeviceDestroyed
condition e.device:owner:race=#race_player&DeviceFocused(e.device,#race_raptor)
:action
LocalEvent(FocusOnDevices);
LocalEvent(GetSecondaryTarget);
:end
END

RULE event ShieldDown
condition e.ship:race=#race_player
:action
LocalEvent(FireMainShield);
:end
END

RULE event ShieldUp
condition E.ship:race=#race_player
:action
LocalEvent(FireMainShield);
:end
END

RULE event FocusOnDevices
:action
PlayerFleetL6:=GetFreeSel();
SelectShips(PlayerFleetL6, s.race=#race_player);
ExecList(PlayerFleetL6,
WGDevL:=GetFreeSel();
SelectDevices(WGDevL, s.this, s.this:damage<100&InSet(S.this, 70));  //focusing on weapon generators
if(isValid(PickFirst(WGDevL)), FocusDevice(PickFirst(WGDevL), #race_raptor, 1));
DeleteSelect(WGDevL);
);
DeleteSelect(PlayerFleetL6);
:end
END

RULE event GetMainTarget
:action
Debug("GetMainTarget");
if(isValid(m.AITeam_leader)&not(m.AITeam_leader:wreck),
PlayerFleetL7:=GetFreeSel();
SelectShips(PlayerFleetL7, s.race=#race_player&range(s.this,m.AITeam_leader)=2&s.this:damage>35); //if there is heavy damaged ship nearby, first finish it off
if(AllNumOf(PlayerFleetL7)>0,
m.mainTarget:=PickMax(PlayerFleetL7,s.this:damage);
,
SelectShips(PlayerFleetL7, s.race=#race_player&range(s.this,m.AITeam_leader)=2); //else we pick most dangerous nearby ship
if(AllNumOf(PlayerFleetL7)>0,
m.mainTarget:=PickMax(PlayerFleetL7, (s.this:tDamage(m.AITeam_leader,2,1)+s.this:tDamage(m.AITeam_leader,2,2)+s.this:tDamage(m.AITeam_leader,2,3)+s.this:tDamage(m.AITeam_leader,3,1)+s.this:tDamage(m.AITeam_leader,3,2)+s.this:tDamage(m.AITeam_leader,3,3)));
,
SelectShips(PlayerFleetL7, s.race=#race_player); //else we pick closest target
if(AllNumOf(PlayerFleetL7)>0, m.mainTarget:=PickMax(PlayerFleetL7, 1 / distance(s.this, m.AITeam_leader)), ChangeState(noTeam0,0));
);
);
ExecList(AIShipSHBusterL,
s.this:tMoveTo(m.mainTarget, 2, 0);
);
LocalEvent(FireMainHull);
LocalEvent(FireMainShield);
DeleteSelect(PlayerFleetL7);
,
LocalEvent(FatalDamaged, E.ship=m.AITeam_leader);
);
:end
END

RULE event GetSecondaryTarget
:action
Debug("GetSecondaryTarget");
if(NumOf(AIShipDeviceBusterL)>0,
if(isValid(m.mainTarget)&not(m.mainTarget:wreck),
PlayerFleetL8:=GetFreeSel();
SelectShips(PlayerFleetL8, s.race=#race_player&(range(s.this,m.mainTarget)=2|range(s.this,m.mainTarget)=3));  // we want to have main target in device buster ships artilery range
if(AllNumOf(PlayerFleetL8)>0, m.secondaryTarget:=PickMax(PlayerFleetL8, (s.this:tDamage(m.AITeam_leader,2,1)+s.this:tDamage(m.AITeam_leader,2,2)+s.this:tDamage(m.AITeam_leader,2,3)+s.this:tDamage(m.AITeam_leader,3,1)+s.this:tDamage(m.AITeam_leader,3,2)+s.this:tDamage(m.AITeam_leader,3,3))), m.secondaryTarget:=m.mainTarget);  //most dangerous opponent
DeleteSelect(PlayerFleetL8);
,
LocalEvent(GetMainTarget);
);
ExecList(AIShipDeviceBusterL,
s.this:tMoveTo(m.secondaryTarget, 2, 0);
);
,
m.secondaryTarget:=m.mainTarget;
);
LocalEvent(FireToSecondary);
:end
END

RULE event GetMissileTarget
:action
Debug("GetMissileTarget");
if(isValid(m.AITeam_leader)&not(m.AITeam_leader:wreck),
PlayerFleetL9:=GetFreeSel();
SelectShips(PlayerFleetL9, s.race=#race_player&range(s.this,m.AITeam_leader)>2);
if(AllNumOf(PlayerFleetL9)>0,
AIFleetL9:=GetFreeSel();
SelectShips(AIFleetL9, s.race=#race_raptor&s.this!=m.AITeam_leader);  // we don't want to have any AI ships in blast range
if(AllNumOf(AIFleetL9)>0,
ExecList(PlayerFleetL9,
PotentialTarget:=s.this;
ExecList(AIFleetL9,
if(range(PotentialTarget,s.this)=2,
RemoveItem(PlayerFleetL9, PotentialTarget);
);
);
);
);
DeleteSelect(AIFleetL9);
if(NumOf(PlayerFleetL9)>0,
m.missileTarget:=PickMax(PlayerFleetL9, 1 / distance(s.this, m.AITeam_leader));
LocalEvent(FireMissile);
);
);
DeleteSelect(PlayerFleetL9);
,
LocalEvent(FatalDamaged, E.ship=m.AITeam_leader);
);
:end
END

RULE event FireMainHull
:action
Debug("FireMainHull");
if(isValid(m.AITeam_leader)&isValid(m.mainTarget)&not(m.mainTarget:wreck)&not(m.AITeam_leader:wreck),
AIFleetL10:=GetFreeSel();
SelectShips(AIFleetL10, s.race=#race_raptor);
ExecList(AIFleetL10,
s.this:tSetForbid(#FORBID_FIRE);
s.this:tSetForbid(#FORBID_FIRE_BOMBER);
AIFleetWeaponL10:=GetFreeSel();
SelectDevices(AIFleetWeaponL10, s.this, S.working&S.weapon&s.count!=0&s.hullValue=1);
ExecList(AIFleetWeaponL10,
s.this:contFire:=1;
ActivateDevice(S.this, 1);
TargetWeapon(s.this, m.mainTarget);
);
DeleteSelect(AIFleetWeaponL10);
AIFleetBomberL10:=GetFreeSel();
SelectDevices(AIFleetBomberL10, s.this, s.hullValue=1&s.working&(Inset(s.this,20)|Inset(s.this,21)|Inset(s.this,22)));
ExecList(AIFleetBomberL10,WeaponMode(S.this,5,m.mainTarget));
DeleteSelect(AIFleetBomberL10);
);
DeleteSelect(AIFleetL10);
);
:end
END

RULE event FireMainShield
:action
Debug("FireMainShield");
if(isValid(m.AITeam_leader)&not(m.AITeam_leader:wreck),
if(isValid(m.mainTarget)&not(m.mainTarget:wreck),
AIFleetL11:=GetFreeSel();
SelectShips(AIFleetL11, s.race=#race_raptor);
ExecList(AIFleetL11,
AIFleetWeaponL11:=GetFreeSel();
SelectDevices(AIFleetWeaponL11, s.this, S.working&S.weapon&s.count!=0&s.hullValue=0&s.shieldValue=1);
ExecList(AIFleetWeaponL11,
s.this:contFire:=1;
ActivateDevice(S.this, 1);
if(m.mainTarget:isShielded,
TargetWeapon(s.this, m.mainTarget);
,
if(isValid(m.secondaryTarget)&not(m.secondaryTarget:wreck)
if(m.secondaryTarget:isShielded,
TargetWeapon(s.this, m.secondaryTarget);
,
PlayerFleetL11:=GetFreeSel();
SelectShips(PlayerFleetL11, s.race=#race_player&s.this:isShielded);
if(AllNumOf(PlayerFleetL11)>0,
TargetWeapon(s.this,PickMax(PlayerFleetL11, 1 / distance(s.this, m.AITeam_leader)));
);
);
,
LocalEvent(GetSecondaryTarget);
);
);
);
);
DeleteSelect(AIFleetL11);
,
LocalEvent(GetMainTarget);
);
);
:end
END

Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 26, 2011, 21:44:25
AND FINALLY the fifth chunk... (DANG thats a crap load of coding)

Code: [Select]
RULE event FireToSecondary
:action
Debug("FireToSecondary");
if(isValid(m.secondaryTarget)&not(m.secondaryTarget:wreck),
AIFleetL12:=GetFreeSel();
SelectShips(AIFleetL12, s.race=#race_raptor);
ExecList(AIFleetL12,
AIFleetWeaponL12:=GetFreeSel();
SelectDevices(AIFleetWeaponL12, s.this, S.working&S.weapon&s.count!=0&s.hullValue=0&s.shieldValue=0&s.DeviceValue=1);
ExecList(AIFleetWeaponL12,
s.this:contFire:=1;
ActivateDevice(S.this, 1);
TargetWeapon(s.this, m.secondaryTarget);
);
DeleteSelect(AIFleetWeaponL12);
AIFleetBomberL12:=GetFreeSel();
SelectDevices(AIFleetBomberL12, s.this, s.hullValue=0&s.shieldValue=0&s.DeviceValue=1&s.working&(Inset(s.this,20)|Inset(s.this,21)|Inset(s.this,22)));
ExecList(AIFleetBomberL12,WeaponMode(S.this,5,m.secondaryTarget));
DeleteSelect(AIFleetBomberL12);
);
DeleteSelect(AIFleetL12);
);
:end
END

RULE event FireMissile
:action
Debug("FireMissile");
if(IsValid(m.missileTarget)&Not(m.missileTarget:wreck),
AIFleetL13:=GetFreeSel();
SelectShips(AIFleetL13, s.race=#race_raptor);
ExecList(AIFleetL13,
s.this:tSetForbid(#FORBID_FIRE_MISSILE);
AIMissileL13:=GetFreeSel();
SelectDevices(AIMissileL13, s.this, s.weapon & s.working & InSet(s.this, 5) & s.count!=0); //missiles & e-bombs
ExecList(AIMissileL13,
s.this:contFire:=1;
ActivateDevice(S.this, 1);
TargetWeapon(S.this, m.missileTarget);
);
DeleteSelect(AIMissileL13);
);
DeleteSelect(AIFleetL13);
,
LocalEvent(FatalDamaged,E.ship=m.missileTarget);
);
:end
END

RULE event FatalDamaged
:action
Debug("realBattleFatalDamaged");
if(e.ship:Race=#race_player,
PlayerFleetL14:=GetFreeSel();
SelectShips(PlayerFleetL14, s.race=#race_player);
if(NumOf(PlayerFleetL14)>0,
if(e.ship=m.mainTarget,
LocalEvent(GetMainTarget);
);
if(e.ship=m.secondaryTarget,
LocalEvent(GetSecondaryTarget);
);
if(e.ship=m.misileTarget,
LocalEvent(GetMissileTarget);
);
,
ChangeState(noTeam0,0);
);
DeleteSelect(PlayerFleetL14);
,
RemoveItem(AIShipDeviceBusterL,e.ship);
RemoveItem(AIShipSHBusterL,e.ship);
if(e.ship=m.AITeam_leader,
AIFleetL14:=GetFreeSel();
SelectShips(AIFleetL14, s.race=#race_raptor);
if(AllNumOf(AIFleetL14)>0, m.AITeam_leader:=PickMax(AIFleetL14, 1 / s.this:tGetMaxVelocity()), ChangeState(noTeam1,0));
DeleteSelect(AIFleetL14);
Delay(0,1,LocalEvent(GetMainTarget),0);
Delay(0,3,LocalEvent(GetSecondaryTarget),0);
Delay(0,5,LocalEvent(GetMissileTarget),0);
);
);
:end
END

END //STATE realBattle

STATE noTeam1

RULE event In
:action
:end
END

END //STATE noTeam1

STATE noTeam0

RULE event In
:action
:end
END

END //STATE noTeam1

END //MACHINE "AI"
Title: Re: The AI and You
Post by: Mularac on September 27, 2011, 00:36:27
Yeah... I found what the error was. The file you put here:

MACHINE "INNER_AI"
#include "11_default_ai.mach"
END

is not the one I meant by when I gave you the first example, but this file: http://arparso.de/nexus/forum/index.php/topic,222.msg1569.html#msg1569 (http://arparso.de/nexus/forum/index.php/topic,222.msg1569.html#msg1569)
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 27, 2011, 00:57:26
Aaaah... ok, glad you were able to figure it out!

I should applaud you for that, in fact i will!  :D

i might post a few more questions / problems i run into in the future here, im sure everyone will benefit from it.

Edit: THANK GOD! it works now! :D

Btw, going clear back to the first page of this topic...

About setting up an area that the AI will kick in if you have a ship go into it... can you make it visible in the editor? i want to make sure i have it in the right place... :-\

OH yeah, and another thing, can you code for a ship appear to be damaged when the mission starts? and where would you put that piece of coding?
Title: Re: The AI and You
Post by: Mularac on September 27, 2011, 05:52:24
area that appears on the editor: nope. You can, however, put a ship in those coordinates and if the radius of the ship is of a similar length to the ARTILLERY and COMBAT ones, then you can use the display options in the mission editor.

Ship appearing damaged: easy as pie. just meddle with this atribute: m.ship:damage := 0 to 100; where 0 means full health and 100 = death. I recommend applying this change just before making that ship appear, to keep the code clear.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 27, 2011, 23:11:25
1- can you set a nav-point in the editor to be the center of said area, then?

2- What if the ship is present in the first place? the ship im planning on applying this to i put in using the mission editor...
Title: Re: The AI and You
Post by: Mularac on September 27, 2011, 23:18:03
This is a bit of a hack, but yeah, you can put a navpoint in the center of an area. In fact, you can actually put an area in relation to a navpoint (way more efficient). Use this command:
Code: [Select]
SetArea(index, centeritem, radius);
Where centeritem can be a navpoint.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 27, 2011, 23:38:26
two questions about that coding...

1- what would the index be? the area in question?

2- you would apply that 'centeritem' thing to an EXISTING navpoint, correct? also how do you make it so that such a navpoint is VISIBLE when you test\play the mission?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 28, 2011, 03:05:03
Going slightly off topic here for a moment...

3- For objectives, what would be the proper code to have it so you need to have a commando squad enter a ship and scan it?
Title: Re: The AI and You
Post by: The Old Dragon on September 28, 2011, 09:45:36
1)   Yes, this is the area in question. It'll be a number from 0 to 9 (You can only set up ten of these areas I think).

2)   For making it visible during the test play, put this in the SceneInit rule...

    MakeFullyKnown(M.AreaNav);
    FreezeReconState(M.AreaNav,1);

    Where M.AreaNav will be the name you assigned to the navpoint you want to display.

3)   Just to clarify, you'd like some coding to update an objective once your commandos have got onboard an enemy ship and survived long enough to "scan" it? I'll have to a bit of digging for something like that...
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 29, 2011, 00:12:07
Hi dragon, good to see you chipping in!  :)

3a) Im simply looking for code that will make that an OBJECTIVE

3b) i didnt even think of the updating objective part, that i would also gladly appreciate, i dont want to just destroy the raptor ships i have hiding about on the mission im focusing on currently.

EDIT: Problem...

The MakeFullyKnown command wants a ship, not a nav point... you sure thats right?

heres what i have...
Code: [Select]
MakeFullyKnown(SOS);
FreezeReconState(SOS,1);

SOS is the name i have for the navigation point, did i mess up on something?  ???
Title: Re: The AI and You
Post by: Mularac on September 29, 2011, 02:31:23
Let us see the declaration of the navpoint, too.
Title: Re: The AI and You
Post by: The Old Dragon on September 29, 2011, 09:46:54
Ok, for the sake of argument, you've added a navpoint via the mission editor called "SOS". In order for the game to be able to see and interact with it, then it'll need a variable name. To assign one, add the following to the SceneInit rule...

   M.SOS:=GetSceneObj("SOS");

So our previous commands to make it visible would now read...

    MakeFullyKnown(M.SOS);
    FreezeReconState(M.SOS,1);

Quick question or two, have you visited the NexusWiki (http://nexusthegame.net/wiki/Beginner%27s_Guide#Nexus:TJI_Basic_mission-making_walkthrough (http://nexusthegame.net/wiki/Beginner%27s_Guide#Nexus:TJI_Basic_mission-making_walkthrough)) and read through the beginners tutorials? You'll find what you need on adding and updating Objectives in there. The only bit you won't find there is a trigger for the update...

Code: [Select]
       RULE event Breached
condition E.location=[size=15pt][color=red]1[/color][/size]&E.ship:launcherWeapon:owner=[size=15pt][color=red]2[/color][/size]
:action

:end
END

1= The variable name that you declared for the raptor ship.
2= The variable name that you declared for the player ship.

Not overly sure about this, but if you have several ships that carry marines, then try changing the "2" to "race_Player ". This rule should hopefully cover all your ships then.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 29, 2011, 22:16:29
Excellent, i got the navpoint working now...

EDIT: i got even better news! the AI for the raptors is now working exactly as i wanted it to in the first place! I had to remove the inclusion of the default AI from the .mission file.

now that i know it works i intend to add more raptor ships into the area. and add large asteroids to hide them.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 29, 2011, 23:06:04
OK, the AI part as far as i know is done.

Now i want to have the music change from contact ghost (the one i have playing in the mission) to contact raptor when the AI turns on. Anyone know exactly how?
Title: Re: The AI and You
Post by: Mularac on September 30, 2011, 03:17:40
Just use the command PlayMusic();
In the file const.ini there is a list with the constants of each track.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on September 30, 2011, 21:12:47
Okey dokie.

I have two vardrag ships in the mission, and thanks to old dragon i know how to link objectives involving commandos to each of them...

I also managed to get the objective stuff in for the mission, again, thanks to old dragon.

however, how would you assign a secret to a ship, and how would you have the script tell the mission to have the commandos scan the ship for it?

I also want to make it so that the ship does not have any 'Security' and thus doesnt cause the commandos to take casualties.

Furthermore, i managed to get away with this coding, not sure if anyone else has tried this, but here it is...
Code: [Select]
EnableEvacBoats(M.Ship.1 ,disable);
The M.Ship.X (x for the number) or E.ship OR P.ship can be used where i put it. Not sure if this is what everyone else does. but for those who have no idea, heres your answer.  ;)

UPDATE:
 I managed to figure out some of the music stuff on my own, i also added in a small gorg fleet to the mission i am focusing on. However, im not quite sure how to code for this gorg fleet to jump in when all the raptor ships (or at least a number of them) have been critically damaged and/or destroyed. Any ideas as to how this can be done?
Title: Re: The AI and You
Post by: The Old Dragon on October 02, 2011, 21:04:58
With regards to ship security, you'll probably have to edit the Tacticstypes.ini and add a new shipclass and shiptype for the raptor ships that you want (unless you want it to affect all of the Raptor ships).

Here's a little script that brings in some "Gorg" ships when the "Raptors" are damaged...

Code: [Select]
MISSION 004
name "Machine Testing"

DefLocation "nav_Pluto"

OBJECTIVES

END

RULES

RULE event SceneInit

:action

//Set the scene size.

SetSceneRadius(200000);

//Ship Naming...

M.R1:=GetSceneObj("Raptor 1");
M.R2:=GetSceneObj("Raptor 2");
M.R3:=GetSceneObj("Raptor 3");
M.R4:=GetSceneObj("Raptor 4");

M.GL:=GetSceneObj("Gorg Lead");

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg_B);

//make the Raptors and Gorgs visible...

M.Visible:=GetfreeSel();
SelectShips(M.Visible,S.race=#race_Raptor|S.race=#race_Gorg_B);
ExecList(M.Visible,
MakeFullyKnown(S.this);
FreezeReconState(S.this,1);
);

CamLocate(M.R1,2,5000,1000,1000,M.GL,2,0,0,0,0,0);

//Hide the gorgs away...

ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);

//Call this machine.

M:=GetMachine("Director"):ChangeState(Start,0);

:end //end action

END //end rule

RULE event cheat0

:action

//Damage Raptor 1...

M.R1:damage:=51;

:end //end action

END //end rule

RULE event cheat1

:action

//Damage Raptor 2...

M.R2:damage:=51;

:end //end action

END //end rule

RULE event cheat2

:action

//Damage Raptor 3...

M.R3:damage:=51;

:end //end action

END //end rule

RULE event cheat3

:action

//Damage Raptor 4...

M.R4:damage:=51;

:end //end action

END //end rule

MACHINE "Director"

STATE Start

RULE event In

:action

:end //end action

END //end rule

RULE event CO_HullLow

condition E.Ship:Race=#race_Raptor

:action

Debug("Raptor Damaged");

M.RaptorThreshhold:=2; //Set the damaged ship limit...


//Now count up any Raptor ships with more 50% health...

M.RaptorCount:=GetFreeSel();
SelectShips(M.RaptorCount,S.race=#race_Raptor&S.this:Damage<50);
Dump(M.RaptorCount);

//Once the number of said ships gets below the threshhold, call in the Gorgs...

If(AllNumOf(M.RaptorCount)<M.RaptorThreshhold, LocalEvent(CallGorg));

:end //end action

END //end rule

RULE event CallGorg

:action

//Set up the direction that the ships will arrive; in this case, the direction that the lead ship has been placed...

JumpVector:=VNeg(R2Vec(M.GL:Orientation));

Debug("Gorgs coming!!");

//Refresh this list so that the required ships arrive...

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg_B);

//Now activate the IP drives...

ExecList(M.GorgFleet,
SetLongRangeDir(s.this,JumpVector,0,0);
LongRangeArrive(S.this);
);

:end //end action

END //end rule

END //end state

END //end machine


END


ENTITIES

SHIP
Name "The Observer"
Race #race_Player
ShipType #Stype_F107_Dragon
Position 17964.2 1469.06 6201.78
Orientation 0 0 0
END

SHIP
Name "Raptor 1"
Race #race_Raptor
ShipType #styp_ep1_OSEC_Longsword_corvette
Position 12149.1 17999.1 -21419
Orientation 0 0 0
END

SHIP
Name "Raptor 2"
Race #race_Raptor
ShipType #styp_ep1_OSEC_Longsword_corvette
Position 12856.6 17999.1 -21772.8
Orientation 0 0 0
END

SHIP
Name "Raptor 3"
Race #race_Raptor
ShipType #styp_ep1_OSEC_Longsword_corvette
Position 12149.1 18706.6 -21772.8
Orientation 0 0 0
END

SHIP
Name "Raptor 4"
Race #race_Raptor
ShipType #styp_ep1_OSEC_Longsword_corvette
Position 11441.6 17999.1 -21772.8
Orientation 0 0 0
END

SHIP
Name "Gorg 2"
Race #race_Gorg_B
ShipType #styp_ep1_Kissaki_frigate
Position 587.514 0 -293.757
Orientation 0 0 0
END

SHIP
Name "Gorg 3"
Race #race_Gorg_B
ShipType #styp_ep1_Kissaki_frigate
Position -587.514 0 -293.757
Orientation 0 0 0
END

SHIP
Name "Gorg Lead"
Race #race_Gorg_B
ShipType #styp_ep1_Kissaki_frigate
Position 0 0 0
Orientation 0 0 0
END

END

You'll probably need to tweak a few things here and there to get it to work in your script, but it should provide the answers...
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 02, 2011, 21:13:49
Thanks for the reply old dragon, each chunk of scripting i manage to finish for this mission im currently focusing on is making the mission all the better. I'll add in a modified version into my mission file.

I think i figured out how to alter the security though... i have yet to test it, but im about to anyway.

heres the code i put in...

Code: [Select]

M.Ship.0:=GetSceneObj("Paradise");
M.Ship.0:Damage:=55 ;
M.Ship.0:security:=0 ;

That is of one of the vardrag ships i have in the current mission, by the way.
the damage coding i put in for it worked like a charm, so im sure the security would work as well... even though i have yet to test it.

Also, heres what the heck im doing in the mission, i have two vardrags ships (which are abandoned and damaged hull integrity wise, have yet to modify damage of devices). Im trying to make it so that you have to find the second one, called 'Atlantis' because it has intel on board of the location of a second gate in the arcturus (a custom one i made) system (i wanted to assign a secret to the Atlantis but i am unsure of wether to use an existing one or just make a whole new one specifically for this mission). the scene is in an asteroid field littered with a layer of vardrag and raptor ship debris. The SOS nav point i have in this mission is supposed to be not only a guide, but also in the script acts as a way for the raptors (which are hiding behind large asteroids) to spring a trap on the player's ships. Thanks to your coding above, i can now have the gorgs arrive in via IP drive to the scene, right where the player's ships started, the reason i added them in there is because they too want the location of the gate, so they can beat the player to the gate and the system it leads to. Unfortunately since Mularac has yet to find a way to put a gate in a standalone custom mission, i cannot add them in.

anyway i hope that got you and mularac up to pace as to the intentions of the mission im working on.

Also, is that actually part of a mission YOU created? That f107_Dragon type definitely isnt in the vanilla version of Nexus: TJI.

And on a side note, if i can fully complete ALL the SP setting missions i have, i might plan on linking them together into a sort of 'sequel campaign', like a nexus 1.5 if you will.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 02, 2011, 22:11:55
Oh great... now the DIRECTOR machine isnt cooperating....

Heres what i got, reply back and highlight anything i need to replace/fill in.

Code: [Select]
RULES

RULE event sceneInit
:action
SetSceneRadius(100000);

SetRelation(#race_player, #race_raptor, 2);
SetRelation(#race_raptor, #race_player, 2);
SetRelation(#race_vardrag, #race_player, 3);
SetRelation(#race_player, #race_vardrag, 3);
SetRelation(#race_vardrag, #race_raptor, 3);
SetRelation(#race_raptor, #race_vardrag, 3);
SetRelation(#race_player, #race_gorg, 2);
SetRelation(#race_gorg, #race_player, 2);
SetRelation(#race_vardrag, #race_gorg, 3);
SetRelation(#race_gorg, #race_vardrag, 3);
SetRelation(#race_raptor, #race_gorg, 2);
SetRelation(#race_gorg, #race_raptor, 2);

PShip.0 := GetSceneObj("Darkstar");
PShip.1 := GetSceneObj("Vanguard");
PShip.2 := GetSceneObj("Eringuard");
PShip.3 := GetSceneObj("Kings Arch");

R.Ship.0 := GetSceneObj("Highlander");
R.Ship.1 := GetSceneObj("Skirmisher");
R.Ship.2 := GetSceneObj("Stingray");
R.Ship.3 := GetSceneObj("Hellstorm");
R.Ship.4 := GetSceneObj("Ball");
R.Ship.5 := GetSceneObj("Chain");
R.Ship.6 := GetSceneObj("Assassin");
R.Ship.7 := GetSceneObj("Rambler");
R.Ship.8 := GetSceneObj("Baron");

G.Ship.1 := GetSceneObj("Argentum");
G.Ship.2 := GetSceneObj("Predator");
G.Ship.3 := GetSceneObj("Warmonger");
G.Ship.4 := GetSceneObj("Exile");
G.Ship.5 := GetSceneObj("Decay");

V.Ship.0:=GetSceneObj("Paradise");
V.Ship.0:Damage:=55 ;
V.Ship.0:security:=0 ;
V.Ship.1:=GetSceneObj("Atlantis");
V.Ship.1:Damage:=20 ;
V.Ship.1:security:=0 ;
V.Ship.1:secret:=0 ;
V.Ship.1:missingSecretPoints:=5000 ;

M.SOS:=GetSceneObj("SOS");
MakeFullyKnown(M.SOS);
FreezeReconState(M.SOS, 1);

Playmusic(22);

GetMachine("Director"):ChangeState(start, 0);
GetMachine("Objectives"):ChangeState(monitor, 0);
GetMachine("ATLANTIS_AI"):ChangeState(idle, 0);
GetMachine("GORG_AI"):ChangeState(battle, 0);
GetMachine("MAIN_AI"):ChangeState(start, 0);

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg);

//Hide the Gorgs away...

ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);
END

MACHINE "Director"

STATE start

RULE event CO_HullLow
condition R.Ship:Race=#race_raptor
:action
Debug("Raptor Damaged");

R.ShipThreshhold:=2;

R.ShipCount:=GetFreeSel();
SelectShips(R.ShipCount, S.race=#race_raptor&S.this:Damage<50);
Dump(R.ShipCount);

IF(AllNumOf(R.ShipCount)<M.RaptorThreshold, LocalEvent(CallGorg));
:end
END

RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.GL:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);

ExecList(M.GorgFleet,
SetLongRangeDir(S.this, JumpVector, 0, 0);
LongRangeArrive(S.this);
);
:end
END
END
END

#include "11_inner_ai.mach"
#include "11_default_obj.mach"
#include "11_default_ai.mach"
#include "11_music_ai.mach"
#include "11_gorg_ai.mach"
#include "11_atlantis_ai.mach"

END

R.Ships = Raptor ships
PShips = Player ships (obviously)
G.Ships = Gorg Ships
V.Ships = Vardrag Ships
M.Ships = Other

Im guessing the spot where i put 'Orientation' needs to be replaced. Am i right?
Title: Re: The AI and You
Post by: Mularac on October 03, 2011, 00:20:00
Take a look at what I wrote here (http://arparso.de/nexus/forum/index.php/topic,127.msg1089.html#msg1089), it should help you understand better the range of each variables.

The prefix before a variable, like "e.ship" or "m.otherShip" are not arbirtrary, they clarify the scope of each variable.

R. prefixes doesn't exist, and you have to be careful with the ones that have m. ones, as they're global variables.
Also, every variable declared in the sceneInit rule (or any rule outside a machine block) is automatically declared as m. variable, and if you want to access it from someplace outside that rule you have to use the m. prefix. Example:

Code: [Select]
RULES
RULE event sceneInit
:action
///... pice of coding
string := "hello world";
///... further code...
:end
END

Machine "smt"
State smt
Rule event in
:action
debug(string); //This will display a 0
debug(m.string); //this will display "Hello world"
:end
END //event in
END //state smt
END //Machine smt
END //rules
Title: Re: The AI and You
Post by: The Old Dragon on October 03, 2011, 09:22:38
Nice spot on the security value, I hadn't noticed that one tucked away  ;)

As Mularac said, you have to be careful with the variable prefix's. You can find a description on the values and uses in the Modding Manual, page 59 I believe (section 8.1.4). Nexus will either ignore your coding or tell you to go suck it's dangly bits, I'm afraid (sometimes it can be very unforgiving  :( ).

So looking at the the 'SceneInit' rule...

You need to either remove all the R.,G.,V.'s or remove and replace them with M.'s instead. I understand your reasoning, but it's more likely to cause issues; changing the names to things like M.GShip.1 should be fine.

(Don't forget to change the names in the 'Entities' section as well or they won't be recognised!)

Now the 'HullLow' rule...

1) The variable prefix in the condition line needs to be an "E." as this represents an Event action. In short, what we're doing is asking the game to check the race value whenever a ship reaches a low hull value (not sure what % damage level triggers it) and only perform the actions in the rule if the ship in question belongs to the Raptors.

2) The Raptor Threshold value; again change this to an M. and change the value. You've got 8 raptors in the scene, so a value of 4 would probably be more appropriate (with the value at 2, the gorgs won't jump in untill there's only 1 healthy raptor left).

3) Just change the remaining  R.ShipCount(s) back to  M.ShipCount(s).

And now the 'CallGorg' Rule...

Only one issue here and you're correct. The M.GL (my variable name for the Gorg ship I chose to be the leader (M.GL=GorgLead)). Change the M.GL to  M.GShip.1 and that should work ok.

Final point, although not strictly required; each state should have it's own "In" rule (and "Out" rule, though I do tend to ignore this one  :) ), even if they are empty rules. All you're saying to the game here is when you enter a state, read this one first (or read that one last).

Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 03, 2011, 22:32:20
Bah humbug... i did all the fising you guys spoke of and the blasted thing is still refusing to cooperate... stinkin' little....  >:(

I have a feeling i need to fill in for a few other spots, ill put the code for the stuff im suspecting below...

Code: [Select]
ExecList(M.GorgFleet,
SetLongRangeDir(S.this, JumpVector, 0, 0);
LongRangeArrive(S.this);
The spot im suspecting i need to change is the JumpVector, 0, 0 part...
Code: [Select]
JumpVector:=VNeg(R2Vec(M.GL:M.Ship.0));
for this coding im guessing i need to change the Vneg and R2Vec  parts.
NOTE: M.Ship.0 is now the Gorg battleship "Argentum" in my mission...

and yes, you're right old... it CAN be very unforgiving. i had to trash two missions (including a previous version of THIS one) because it wouldn't cooperate no matter how hard i tried to fix it. Im not sad, im just really frustrated with it...  >:(
Title: Re: The AI and You
Post by: Mularac on October 03, 2011, 22:56:35
your problem there is that the JumpVector variable contains a vector, and the game expects a number. what you should use is this:

SetLongRangeDir(S.this, JumpVector:x, JumpVector:y, JumpVector:z);
Title: Re: The AI and You
Post by: The Old Dragon on October 04, 2011, 01:37:31
The Execlist section is fine, providing that the list M.GorgFleet is populated by the Gorg ships you want to jump in. The error is in the JumpVector that you've declared, let me see if I can break this down a little...

JumpVector - No problems here, we're just providing a name for the variable (you could call it Fred if you really wanted; but looking back on it at a later date; you'd probably sit there scratching your head trying to figure out what you were on at the time).

VNeg - Again no issues here. This part tells Nexus that we want to put the 'Jump field' (that blue sparkly, strippy kind of thing) in front of the ship, as opposed to behind it when a ship is jumping out (I think changing this to VNorm will do this).

R2Vec - As I understand it, this is the direction that we want the ship to be facing when it jumps in or out of the scene. It must contain a value in brackets to function properly. It is this section that contains the error.

At the moment, you're telling the Gorg ships to jump in facing the direction M.GL ( a variable that I don't think you have defined) and you've attached a value/command to this variable with the use of a ':'.

So to fix it, all you need to do is replace...

Code: [Select]
JumpVector:=VNeg(R2Vec(M.GL:M.Ship.0));
with...

Code: [Select]
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));
Now we're telling the Gorg ships to jump in facing the same direction as the ship 'Argentum'.

If you're still having problems, you could attach the mission file to one of your posts and one or more of us can have a look and iron out the issues.

On a completely different note that I didn't answer in my previous post; the F107 is part of Vanilla Nexus, it's a little something that I'm working on when I get the time.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 04, 2011, 03:57:17
OH COME ON!  >:(

the blasted thing is still acting up....

heres the entire director machine in the  mission file...

Code: [Select]
MACHINE "Director"

STATE start

RULE event CO_HullLow
condition E.Ship:Race=#race_raptor
:action
Debug("Raptor Damaged");

E.ShipThreshhold:=4;

E.ShipCount:=GetFreeSel();
SelectShips(E.ShipCount, S.race=#race_raptor&S.this:Damage<50);
Dump(E.ShipCount);

IF(AllNumOf(E.ShipCount)<E.RaptorThreshold, LocalEvent(CallGorg));
:end
END

RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);

ExecList(M.GorgFleet,
SetLongRangeDir(S.this, JumpVector, 0, 0);
LongRangeArrive(S.this);
);
:end
END
END
END

#include "11_inner_ai.mach"
#include "11_default_obj.mach"
#include "11_default_ai.mach"
#include "11_music_ai.mach"
#include "11_gorg_ai.mach"
#include "11_atlantis_ai.mach"

END

and heres what precedes that....

Code: [Select]
MISSION 11
Name "The Atlantis"
DefLocation "ASTFLD_ARCTURUS IID"

OBJECTIVES
1 // At least one ship must survive
2 // Eliminate any hostiles that encroach the area
3 // Search any derelict vessels or structures
4 // Investigate the 'Paradise' for intel
5 // Investigate the 'Atlantis' for Intel
END

RULES

RULE event sceneInit
:action
SetSceneRadius(100000);

SetRelation(#race_player, #race_raptor, 2);
SetRelation(#race_raptor, #race_player, 2);
SetRelation(#race_vardrag, #race_player, 3);
SetRelation(#race_player, #race_vardrag, 3);
SetRelation(#race_vardrag, #race_raptor, 3);
SetRelation(#race_raptor, #race_vardrag, 3);
SetRelation(#race_player, #race_gorg, 2);
SetRelation(#race_gorg, #race_player, 2);
SetRelation(#race_vardrag, #race_gorg, 3);
SetRelation(#race_gorg, #race_vardrag, 3);
SetRelation(#race_raptor, #race_gorg, 2);
SetRelation(#race_gorg, #race_raptor, 2);

PShip.0 := GetSceneObj("Darkstar");
PShip.1 := GetSceneObj("Vanguard");
PShip.2 := GetSceneObj("Eringuard");
PShip.3 := GetSceneObj("Kings Arch");

EShip.0 := GetSceneObj("Highlander");
EShip.1 := GetSceneObj("Skirmisher");
EShip.2 := GetSceneObj("Stingray");
EShip.3 := GetSceneObj("Hellstorm");
EShip.4 := GetSceneObj("Ball");
EShip.5 := GetSceneObj("Chain");
EShip.6 := GetSceneObj("Assassin");
EShip.7 := GetSceneObj("Rambler");
EShip.8 := GetSceneObj("Baron");

M.Ship.0 := GetSceneObj("Argentum");
M.Ship.1 := GetSceneObj("Predator");
M.Ship.2 := GetSceneObj("Warmonger");
M.Ship.3 := GetSceneObj("Exile");
M.Ship.4 := GetSceneObj("Decay");

M.Ship.5:=GetSceneObj("Paradise");
M.Ship.5:Damage:=55 ;
M.Ship.5:security:=0 ;
M.Ship.6:=GetSceneObj("Atlantis");
M.Ship.6:Damage:=20 ;
M.Ship.6:security:=0 ;
M.Ship.6:secret:=1 ;
M.Ship.6:missingSecretPoints:=5000 ;

M.SOS:=GetSceneObj("SOS");
MakeFullyKnown(M.SOS);
FreezeReconState(M.SOS, 1);

Playmusic(22);

GetMachine("Director"):ChangeState(start, 0);
GetMachine("Objectives"):ChangeState(monitor, 0);
GetMachine("ATLANTIS_AI"):ChangeState(idle, 0);
GetMachine("GORG_AI"):ChangeState(battle, 0);
GetMachine("MAIN_AI"):ChangeState(start, 0);

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg);

//Hide the Gorgs away...

ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);
END
Title: Re: The AI and You
Post by: Mularac on October 04, 2011, 04:58:14
this part is wrong:

SetLongRangeDir(S.this, JumpVector, 0, 0);

it should be:

SetLongRangeDir(S.this, JumpVector:x, JumpVector:y, JumpVector:z);

What's the error message anyway? how is it acting up?
Title: Re: The AI and You
Post by: The Old Dragon on October 04, 2011, 09:22:02
@Mularac,

As long as the 'JumpVector' variable has been properly defined, then both methods work equally well. The X,Y,Z coordinates are handled by the 'orientation' of the target ship (in this case, M.Ship.0).

@SMT

We really need to see the mission script in it's entirety, from the first line right down to the end of the entities section as the error could lie anywhere (many is the time I've banged my head against a bit of code only to find the error responsible elsewhere  :( ). There is also the possibility of an error being in one of the included machines as well.

But for now, I agree with Mul... what error messages are you getting?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 07, 2011, 21:43:16
Its only giving me a specific error, saying that this is an invalid keyword....

>>>MACHINE<<< Director

heres what i have in the entities section: (excluding asteroids, i have a crap load of them listed in there.)

Code: [Select]
SHIP
Name "Eringuard"
Race #race_Player
Class #cls_Cruiser
Position -6338.39 7170.22 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Vanguard"
Race #race_Player
Class #cls_Cruiser
Position -7892.72 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Kings Arch"
Race #race_Player
Class #cls_Battleship
Position -6338.39 5615.88 -19554.5
Orientation 0 0 0
Devices #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_eTorp #weap_eTorp #weap_sigLaser #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_acomDrive #eng_mjumpDrive #supp_ecm2 #supp_eccm2 #supp_bSGen3 #supp_bSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_bWGen3 #weap_aFighter #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Darkstar"
Race #race_Player
Class #cls_AngelwingM
Position -4784.05 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #weap_angels_mecha #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_ucomDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_sensor #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_marine #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Ball"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3603.25 5287.34 19509.6
Orientation -178.2 22.0841 -7.04962
END

SHIP
Name "Chain"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3789.32 5280.72 19544
Orientation -177.718 23.0759 2.27053
END

SHIP
Name "Highlander"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18226.1 11036.3 25970.8
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Skirmisher"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18094.5 11081.7 26147.3
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Assassin"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1058.6 21567.8 24387.7
Orientation -114.473 -26.0238 -56.4949
END

SHIP
Name "Hellstorm"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12457.9 10486.4 15584
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Rambler"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1007.56 21740.1 24592.4
Orientation -114.014 -51.5109 -55.456
END

SHIP
Name "Stingray"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12469.3 10476 15331.1
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Baron"
TechCat 21 40
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Master
Position -24736.8 12269.3 13453.2
Orientation -39.2563 -13.9692 -6.39179
END

SHIP
Name "Decay"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -6138.48 3237.42 -907.067
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Exile"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -6102.67 6275.68 -875.467
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Predator"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -4601.53 4738.41 -868.567
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Warmonger"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -7639.62 4774.69 -913.967
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Argentum"
TechCat 31 30
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Battleship
Position -6109.12 4764.31 -1650.77
Orientation -179.136 0.585114 0.68406
Devices #weap_g_heLaser #weap_g_heLaser #weap_g_plasma #weap_g_plasma#weap_g_plasma #weap_g_plasma #weap_g_eTorp #weap_g_eTorp #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_bSGen #supp_sensor #supp_res #supp_res #supp_res #supp_res #supp_res #supp_res #supp_longRange #supp_bWGen ;
END

SHIP
Name "Paradise"
TechCat 61 50
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_CityShip
Position -2069.99 3914.59 21530.5
Orientation 179.866 3.32864 39.832
END

SHIP
Name "Atlantis"
TechCat 61 25
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_Multi
Position 12026.7 5357.2 61686.2
Orientation -115.552 -22.225 43.9163
END

SHIP
Name "SOS"
Class #Navigation_Point
Behaviour 5
Color 2 2 0
Position -5407.25 5181.96 10249.5
Orientation 0 0 0
END

Title: Re: The AI and You
Post by: The Old Dragon on October 07, 2011, 23:47:12
Think I've spotted the problem. Looking back at the code you posted, your SceneInit rule is missing an 'end'.

Each rule follows this format...

RULE event #name#

      :action

      :end

END

Add the red ':end' into your SceneInit rule and that should fix this error.

Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 08, 2011, 19:39:24
OF COURSE!!! why didnt i see that?!?!   :o

Thanks a bunch for noticing that Old Dragon!  ;)

EDIT: AARRRGG!  >:(

the error STILL lives....

alright, thats it... heres the ENTIRE mission file (excluding asteroids)... all in one piece, HAVE AT IT BOYS!  :-X

Code: [Select]
MISSION 11
Name "The Atlantis"
DefLocation "ASTFLD_ARCTURUS IID"

OBJECTIVES
1 // At least one ship must survive
2 // Eliminate any hostiles that encroach the area
3 // Search any derelict vessels or structures
4 // Investigate the 'Paradise' for intel
5 // Investigate the 'Atlantis' for Intel
END

RULES

RULE event sceneInit
:action
SetSceneRadius(100000);

SetRelation(#race_player, #race_raptor, 2);
SetRelation(#race_raptor, #race_player, 2);
SetRelation(#race_vardrag, #race_player, 3);
SetRelation(#race_player, #race_vardrag, 3);
SetRelation(#race_vardrag, #race_raptor, 3);
SetRelation(#race_raptor, #race_vardrag, 3);
SetRelation(#race_player, #race_gorg, 2);
SetRelation(#race_gorg, #race_player, 2);
SetRelation(#race_vardrag, #race_gorg, 3);
SetRelation(#race_gorg, #race_vardrag, 3);
SetRelation(#race_raptor, #race_gorg, 2);
SetRelation(#race_gorg, #race_raptor, 2);

PShip.0 := GetSceneObj("Darkstar");
PShip.1 := GetSceneObj("Vanguard");
PShip.2 := GetSceneObj("Eringuard");
PShip.3 := GetSceneObj("Kings Arch");

EShip.0 := GetSceneObj("Highlander");
EShip.1 := GetSceneObj("Skirmisher");
EShip.2 := GetSceneObj("Stingray");
EShip.3 := GetSceneObj("Hellstorm");
EShip.4 := GetSceneObj("Ball");
EShip.5 := GetSceneObj("Chain");
EShip.6 := GetSceneObj("Assassin");
EShip.7 := GetSceneObj("Rambler");
EShip.8 := GetSceneObj("Baron");

M.Ship.0 := GetSceneObj("Argentum");
M.Ship.1 := GetSceneObj("Predator");
M.Ship.2 := GetSceneObj("Warmonger");
M.Ship.3 := GetSceneObj("Exile");
M.Ship.4 := GetSceneObj("Decay");

M.Ship.5:=GetSceneObj("Paradise");
M.Ship.5:Damage:=55 ;
M.Ship.5:security:=0 ;
M.Ship.6:=GetSceneObj("Atlantis");
M.Ship.6:Damage:=20 ;
M.Ship.6:security:=0 ;

M.SOS:=GetSceneObj("SOS");
MakeFullyKnown(M.SOS);
FreezeReconState(M.SOS, 1);

Playmusic(22);

GetMachine("Director"):ChangeState(start, 0);
GetMachine("Objectives"):ChangeState(monitor, 0);
GetMachine("ATLANTIS_AI"):ChangeState(idle, 0);
GetMachine("GORG_AI"):ChangeState(battle, 0);
GetMachine("MAIN_AI"):ChangeState(start, 0);

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg);

//Hide the Gorgs away...

ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);
:end
END
END

MACHINE "Director"

STATE start

RULE event CO_HullLow
condition E.Ship:Race=#race_raptor
:action
Debug("Raptor Damaged");

E.ShipThreshhold:=4;

E.ShipCount:=GetFreeSel();
SelectShips(E.ShipCount, S.race=#race_raptor&S.this:Damage<50);
Dump(E.ShipCount);

IF(AllNumOf(E.ShipCount)<E.RaptorThreshold, LocalEvent(CallGorg));
:end
END

RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);

ExecList(M.GorgFleet,
SetLongRangeDir(S.this, JumpVector:-7892.72, 5615.88, -22831.7);
LongRangeArrive(S.this);
);
:end
END
END
END

#include "11_inner_ai.mach"
#include "11_default_obj.mach"
#include "11_default_ai.mach"
#include "11_music_ai.mach"
#include "11_gorg_ai.mach"
#include "11_atlantis_ai.mach"

END


ENTITIES

SHIP
Name "Eringuard"
Race #race_Player
Class #cls_Cruiser
Position -6338.39 7170.22 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Vanguard"
Race #race_Player
Class #cls_Cruiser
Position -7892.72 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Kings Arch"
Race #race_Player
Class #cls_Battleship
Position -6338.39 5615.88 -19554.5
Orientation 0 0 0
Devices #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_eTorp #weap_eTorp #weap_sigLaser #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_acomDrive #eng_mjumpDrive #supp_ecm2 #supp_eccm2 #supp_bSGen3 #supp_bSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_bWGen3 #weap_aFighter #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Darkstar"
Race #race_Player
Class #cls_AngelwingM
Position -4784.05 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #weap_angels_mecha #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_ucomDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_sensor #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_marine #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Ball"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3603.25 5287.34 19509.6
Orientation -178.2 22.0841 -7.04962
END

SHIP
Name "Chain"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3789.32 5280.72 19544
Orientation -177.718 23.0759 2.27053
END

SHIP
Name "Highlander"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18226.1 11036.3 25970.8
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Skirmisher"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18094.5 11081.7 26147.3
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Assassin"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1058.6 21567.8 24387.7
Orientation -114.473 -26.0238 -56.4949
END

SHIP
Name "Hellstorm"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12457.9 10486.4 15584
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Rambler"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1007.56 21740.1 24592.4
Orientation -114.014 -51.5109 -55.456
END

SHIP
Name "Stingray"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12469.3 10476 15331.1
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Baron"
TechCat 21 40
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Master
Position -24736.8 12269.3 13453.2
Orientation -39.2563 -13.9692 -6.39179
END

SHIP
Name "Decay"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -6138.48 3237.42 -907.067
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Exile"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -6102.67 6275.68 -875.467
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Predator"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -4601.53 4738.41 -868.567
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Warmonger"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -7639.62 4774.69 -913.967
Orientation -179.136 0.585114 0.68406
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Argentum"
TechCat 31 30
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Battleship
Position -6109.12 4764.31 -1650.77
Orientation -179.136 0.585114 0.68406
Devices #weap_g_heLaser #weap_g_heLaser #weap_g_plasma #weap_g_plasma #weap_g_plasma #weap_g_plasma #weap_g_eTorp #weap_g_eTorp #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_bSGen #supp_sensor #supp_res #supp_res #supp_res #supp_res #supp_res #supp_res #supp_longRange #supp_bWGen ;
END

SHIP
Name "Paradise"
TechCat 61 50
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_CityShip
Position -2069.99 3914.59 21530.5
Orientation 179.866 3.32864 39.832
END

SHIP
Name "Atlantis"
TechCat 61 25
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_Multi
Position 12026.7 5357.2 61686.2
Orientation -115.552 -22.225 43.9163
END

SHIP
Name "SOS"
Class #Navigation_Point
Behaviour 5
Color 2 2 0
Position -5407.25 5181.96 10249.5
Orientation 0 0 0
END

I also forgot to mention something, How is it that you get an error if you copy the NPC of a ship from one mission to a similar ship on another mission? Perhaps a bug in the system? ive done this with some other things and it works completely fine...
Title: Re: The AI and You
Post by: Mularac on October 08, 2011, 19:45:53
Could you just rar your entire mod and upload it somewhere?
At this point I think that the only way we can hunt down that bug is if we know everything about your mod.

EDIT: Nevermind, found the error.

You've ended your Sceneinit rule with two ends, basically ending the RULES block with it.

it should be:
Code: [Select]
RULES
RULE event SceneInit
:action
<... etc ...>
:end
END

MACHINE "Director"
<... etc ...>
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 09, 2011, 19:04:26
BINGO!!!!!  :D

that was the problem right there!!!!

Thanks a bunch mularac!  ;D

ill reply back again as soon as i asses how the mission runs...  ;)
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 09, 2011, 19:12:18
Ok, now i ran into an odd problem...

the mission works fine now... but the gorg ships, EVEN THOUGH YOU CANT SEE THEM, are shooting lasers at my ships, i have them right behind the player's ships... should i move them further back, or is there a way to prevent this from happening?

Edit: Nevermind, managed to fix it myself, just had to put the GetMachine code that recalls the GORG_AI into the coding that calls for the jump arrival of the gorg fleet.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 09, 2011, 19:41:04
Now another problem.... the gorgs wont jump in!  >:(

heres what i have that calls the event....

Code: [Select]
RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);

ExecList(M.GorgFleet,
SetLongRangeDir(S.this, JumpVector:-7892.72, 5615.88, -22831.7);
LongRangeArrive(S.this);
GetMachine("GORG_AI"):ChangeState(battle,0);
);
:end
Title: Re: The AI and You
Post by: Mularac on October 09, 2011, 20:35:05
put a debug line inside the loop, something like

Code: [Select]
execlist(M.GorgFleet,
debug("---->",s.this,"<----");
//rest of the code
);

and tell us what appears in the console screen

Also, you may want to place the GetMachine:ChangeState piece of coding outside of the execlist loop, that's aweful programming style, the GetMachine:changeState is called at every iteration there, and that can cause trouble further down the road.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 14, 2011, 00:00:01
Hmm.... well if i put the GetMachine with the others where it belongs, the gorgs start moving around while their invisible and open fire....

Anyway i may have figured out why the jump-in for the gorgs isnt working...

could the lower part of this coding be the problem?

Code: [Select]
ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);

i tried the debug and nothing changed....

EDIT: did you mean have a getmachine for the gorgs outside the execlist loop Also? or get rid of the one in the execlist?
Title: Re: The AI and You
Post by: Mularac on October 14, 2011, 00:14:55
I meant that you should move it from the execlist loop. It doesn't belong there.

The debug line isn't supposed to do anything but show information in the console. Run it again and post what it appears there.

The gorg fleets being invisible is due the fact they are hidden. What you want is to have them disappeared instead. Change the:

Code: [Select]
ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);

to:

Code: [Select]
ExecList(M.GorgFleet,Disappear(S.this));
Dump(M.GorgFleet);

Also, what does the dump command show in the game console?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 14, 2011, 21:08:28
After tweaking the AI that controls the music of the mission so that the third song does not start as soon as one raptor ship is destroyed / evacuated, now i get an error when i try to open up the mission.

I was just about to see how the mission ran in the console when i got an error...

It now says that it does not recognize the >>>MACHINE<<< GORG_AI...

Do i need to put in code for the jump into the AI as well?

heres what i have for it in the MISSION file...

Code: [Select]
RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);


ExecList(M.GorgFleet,
Debug("S.this");
SetLongRangeDir(S.this, JumpVector:-7892.72, 5615.88, -22831.7);
LongRangeArrive(S.this);
);
Title: Re: The AI and You
Post by: Mularac on October 16, 2011, 00:01:10
I'm not seeing the call to the gorg machine here...
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 18, 2011, 23:30:12
what should i do then? everything else in the mission file looks fine.... heres the rest i currently have that could possibly be of interest.

Code: [Select]
RULES

RULE event sceneInit
:action
SetSceneRadius(100000);

SetRelation(#race_player, #race_raptor, 2);
SetRelation(#race_raptor, #race_player, 2);
SetRelation(#race_vardrag, #race_player, 3);
SetRelation(#race_player, #race_vardrag, 3);
SetRelation(#race_vardrag, #race_raptor, 3);
SetRelation(#race_raptor, #race_vardrag, 3);
SetRelation(#race_player, #race_gorg, 2);
SetRelation(#race_gorg, #race_player, 2);
SetRelation(#race_vardrag, #race_gorg, 3);
SetRelation(#race_gorg, #race_vardrag, 3);
SetRelation(#race_raptor, #race_gorg, 2);
SetRelation(#race_gorg, #race_raptor, 2);

PShip.0 := GetSceneObj("Darkstar");
PShip.1 := GetSceneObj("Vanguard");
PShip.2 := GetSceneObj("Eringuard");
PShip.3 := GetSceneObj("Kings Arch");

EShip.0 := GetSceneObj("Highlander");
EShip.1 := GetSceneObj("Skirmisher");
EShip.2 := GetSceneObj("Stingray");
EShip.3 := GetSceneObj("Hellstorm");
EShip.4 := GetSceneObj("Ball");
EShip.5 := GetSceneObj("Chain");
EShip.6 := GetSceneObj("Assassin");
EShip.7 := GetSceneObj("Rambler");
EShip.8 := GetSceneObj("Baron");

M.Ship.0 := GetSceneObj("Argentum");
M.Ship.1 := GetSceneObj("Predator");
M.Ship.2 := GetSceneObj("Warmonger");
M.Ship.3 := GetSceneObj("Exile");
M.Ship.4 := GetSceneObj("Decay");

M.Ship.5:=GetSceneObj("Paradise");
M.Ship.5:Damage:=55 ;
M.Ship.5:security:=0 ;
M.Ship.6:=GetSceneObj("Atlantis");
M.Ship.6:Damage:=20 ;
M.Ship.6:security:=0 ;

M.SOS:=GetSceneObj("SOS");
MakeFullyKnown(M.SOS);
FreezeReconState(M.SOS, 1);

Playmusic(21);

GetMachine("Director"):ChangeState(start, 0);
GetMachine("Objectives"):ChangeState(monitor, 0);
GetMachine("ATLANTIS_AI"):ChangeState(idle, 0);
GetMachine("MAIN_AI"):ChangeState(start, 0);
GetMachine("MUSIC_AI"):ChangeState(start, 0);
GetMachine("GORG_AI"):ChangeState(battle,0);

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet,S.race=#race_Gorg);

//Hide the Gorgs away...

ExecList(M.GorgFleet,Disappear(S.this));
Dump(M.GorgFleet);
:end
END

MACHINE "Director"

STATE start

RULE event CO_HullLow
condition E.Ship:Race=#race_raptor
:action
Debug("Raptor Damaged");

E.ShipThreshhold:=4;

E.ShipCount:=GetFreeSel();
SelectShips(E.ShipCount, S.race=#race_raptor&S.this:Damage<50);
Dump(E.ShipCount);

IF(AllNumOf(E.ShipCount)<E.RaptorThreshold, LocalEvent(CallGorg));
:end
END

RULE event CallGorg
:action
JumpVector:=VNeg(R2Vec(M.Ship.0:Orientation));

M.GorgFleet:=GetFreeSel();
SelectShips(M.GorgFleet, S.race=#race_gorg);


ExecList(M.GorgFleet,
Debug("S.this");
SetLongRangeDir(S.this, JumpVector:-7892.72, 5615.88, -22831.7);
LongRangeArrive(S.this);
);
:end
END
END
END

#include "11_inner_ai.mach"
#include "11_default_obj.mach"
#include "11_default_ai.mach"
#include "11_music_ai.mach"
#include "11_gorg_ai.mach"
#include "11_atlantis_ai.mach"

END


ENTITIES

SHIP
Name "Eringuard"
Race #race_Player
Class #cls_Cruiser
Position -6338.39 7170.22 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Vanguard"
Race #race_Player
Class #cls_Cruiser
Position -7892.72 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_heLaser3 #weap_heLaser3 #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_mjumpDrive #eng_comDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Kings Arch"
Race #race_Player
Class #cls_Battleship
Position -6338.39 5615.88 -19554.5
Orientation 0 0 0
Devices #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_plasma3 #weap_eTorp #weap_eTorp #weap_sigLaser #weap_flak3 #weap_flak3 #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_acomDrive #eng_mjumpDrive #supp_ecm2 #supp_eccm2 #supp_bSGen3 #supp_bSGen3 #supp_mSGen3 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_res4 #supp_bWGen3 #weap_aFighter #weap_aFighter #weap_aFighter #weap_aFighter ;
END

SHIP
Name "Darkstar"
Race #race_Player
Class #cls_AngelwingM
Position -4784.05 5615.88 -20331.7
Orientation 0 0 0
Devices #weap_eShell3 #weap_eShell3 #weap_gh_heLaser #weap_gh_heLaser #weap_plasma3 #weap_plasma3 #weap_flak3 #weap_flak3 #weap_angels_mecha #shld_v_c125/125 #eng_bAmatEng #eng_secPlasEng #eng_ucomDrive #supp_ecm2 #supp_eccm2 #supp_mSGen3 #supp_sensor #supp_res4 #supp_res4 #supp_res4 #supp_longRange #supp_cWGen3 #weap_marine #weap_aFighter #weap_aFighter ;

NPC
Name "Austin Cunningham"

Face 012
Rank 7
Medals ;
CrewLevel 3
Skill 1 9
Skill 2 6
Skill 3 8
XP 0

NPC
Name "Aaron Neids"

Face 017
Rank 4
Skill 1 1
Skill 2 10
Skill 3 9
END

SHIP
Name "Ball"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3603.25 5287.34 19509.6
Orientation -178.2 22.0841 -7.04962
END

SHIP
Name "Chain"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -3789.32 5280.72 19544
Orientation -177.718 23.0759 2.27053
END

SHIP
Name "Highlander"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18226.1 11036.3 25970.8
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Skirmisher"
TechCat 21 20
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Hunter
Position -18094.5 11081.7 26147.3
Orientation -98.1635 -5.24808 -15.8153
END

SHIP
Name "Assassin"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1058.6 21567.8 24387.7
Orientation -114.473 -26.0238 -56.4949
END

SHIP
Name "Hellstorm"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12457.9 10486.4 15584
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Rambler"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position -1007.56 21740.1 24592.4
Orientation -114.014 -51.5109 -55.456
END

SHIP
Name "Stingray"
TechCat 21 30
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Killer
Position 12469.3 10476 15331.1
Orientation 119.146 -10.0708 -2.43697
END

SHIP
Name "Baron"
TechCat 21 40
TechPointsScanned 0
Race #race_Raptor
ShipType #styp_ep2_Master
Position -24736.8 12269.3 13453.2
Orientation -39.2563 -13.9692 -6.39179
END

SHIP
Name "Decay"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -5919.95 4629.81 -49106.1
Orientation 0.498365 0.388707 -1.21973
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Exile"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Destroyer
Position -5855.1 7667.66 -49126.2
Orientation 0.498365 0.388707 -1.21973
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_eShell #weap_g_flak #shld_g_s123/123 #eng_sPlasEng #eng_secPlasEng #eng_tacDrive #supp_ecm #supp_eccm #supp_sSGen #supp_sensor #supp_ipblocker #supp_res #supp_res #supp_res #supp_longRange #supp_tWGen ;
END

SHIP
Name "Predator"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -7406.48 6181.1 -49129.6
Orientation 0.498365 0.388707 -1.21973
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Warmonger"
TechCat 31 20
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Cruiser
Position -4368.54 6116.42 -49102.8
Orientation 0.498365 0.388707 -1.21973
Devices #weap_g_liLaser #weap_g_liLaser #weap_g_liLaser #weap_g_heLaser #weap_g_heLaser #weap_g_heLaser #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_mSGen #supp_sensor #supp_res #supp_res #supp_res #supp_longRange #supp_cWGen ;
END

SHIP
Name "Argentum"
TechCat 31 30
TechPointsScanned 0
Race #race_Gorg
Class #cls_gorg_Battleship
Position -5894.13 6153.9 -48356.6
Orientation 0.498365 0.388707 -1.21973
Devices #weap_g_heLaser #weap_g_heLaser #weap_g_plasma #weap_g_plasma #weap_g_plasma #weap_g_plasma #weap_g_eTorp #weap_g_eTorp #weap_g_flak #weap_g_flak #shld_g_b123/123 #eng_bPlasEng #eng_secPlasEng #eng_comDrive #supp_ecm #supp_eccm #supp_bSGen #supp_sensor #supp_res #supp_res #supp_res #supp_res #supp_res #supp_res #supp_longRange #supp_bWGen ;
END

SHIP
Name "Paradise"
TechCat 61 50
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_CityShip
Position -2069.99 3914.59 21530.5
Orientation 179.866 3.32864 39.832
END

SHIP
Name "Atlantis"
TechCat 61 25
TechPointsScanned 0
Race #race_Vardrag
Class #cls_var_Multi
Position 12026.7 5357.2 61686.2
Orientation -115.552 -22.225 43.9163
END

SHIP
Name "SOS"
Class #Navigation_Point
Behaviour 5
Color 2 2 0
Position -5407.25 5181.96 10249.5
Orientation 0 0 0
END


Title: Re: The AI and You
Post by: Mularac on October 18, 2011, 23:52:44
Well, the first mistake I see is that you never ended the NPC block, it should be:

 NPC
         Name "Austin Cunningham"

         Face 012
         Rank 7
         Medals ;
         CrewLevel 3
         Skill 1 9
         Skill 2 6
         Skill 3 8
         XP 0
END

Also, you never ended the entities block, you should place an END at the bottom of the file.
This is going nowhere, can you put all the files together and upload them somewhere for us to test it?
Title: Re: The AI and You
Post by: Mularac on October 19, 2011, 23:30:00
Found your error, the 7_music_ai.mach file had an extra "END" at the bottom. Delete that and that problem should be fixed.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 20, 2011, 21:21:29
Ok sweet, thank you mularac.

ill let you know if i run into anything else

EDIT: now i just remembered about solving the problem with the gorgs not jumping in... Im totally new to using the console, so a guidline to how i should proceed with diagnosing the problem using it would be appreciated. Or if you have the spare time you can find it using your copy of the game's editor, i dont mind whichever you prefer.
Title: Re: The AI and You
Post by: The Old Dragon on October 21, 2011, 00:17:44
Well, with a little bit of fiddling SMT, I've got your mission to at least start without crashing... now the raptors are running away from me. I know I'm scary ;) but I don't think this is what's intended.

I take it you have a detailed plan of how the mission plays out? Would you mind sending it to me via P.M. ?That way I can try and figure out who isn't playing ball... and do you have any other files that are relevant to this mission (for displaying the proper objectives, etc)?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 21, 2011, 02:08:38
Hi old dragon! glad your back into the subject!

1. Sure, ill gladly PM that to you, ill get right on that.

2. if you downloaded all the files i put up last night then there arent any others as of yet.

3. Glad you're looking into a fellow fan's mission!  8)
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 21, 2011, 02:24:33
I also forgot to give both of you the file for the system the mission is in, now you both can succesfully test it without a hitch.  8)

on a side note you can comment on the detail of the system if you want to, im open to criticism on most of the work i do, if the criticism is from professionals.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 22, 2011, 22:11:38
Old Dragon-

  I got a subject now opened up over possibly incorporating this mission into a campaign later on.... heres the link.

http://arparso.de/nexus/forum/index.php/topic,342.msg2364.html#new (http://arparso.de/nexus/forum/index.php/topic,342.msg2364.html#new)
Title: Re: The AI and You
Post by: The Old Dragon on October 23, 2011, 00:23:18
Hi there SMT,

Aye, I had a quick read. Certainly plenty to work with.
With regards to mission 7...

As I mentioned in an earlier post, I've got it to launch without the initial crash. Rewritten the objectives machine, also added an objectives .ini file and moved a few of the smaller machines into the mission file. Main problem with having so many include files for each mission is that you'll have a hell of a lot of files where you'd only need a few.

Next task is going to be looking into the AI's, raptors run away when I get near to them.

As a general rule, I mainly use include files if a machine is going to be used by more than one mission or would make a mission file overly big.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on October 23, 2011, 04:03:26
Great. Im glad your making progress with that.

take your time man, its not like im on a schedule, work on the campaign starts whenever i get to it....
Title: Re: The AI and You
Post by: The Old Dragon on November 03, 2011, 00:30:33
Hi there SMT,

Sorry, not been able to add much more to the files you posted. Currently working on two or three other projects at the mo, but here's the latest that I have for now.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 04, 2011, 00:28:30
Ive got good news and rather bad news....

 the good news is im able to check on here via my dad's laptop, thank GOD we have three computers.

the bad news is my desktop has gone on the fritz, so until our tech whiz neighbor figures out the problem and fixes it, i will be on the laptop.

anyway that is good to hear dragon. i got more news on my campaign topic in the mods board.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 06, 2011, 22:52:29
Now i have MORE good news and bad news...

Good news is my computer is running again, it turned out to be a faulty fan.

the bad news is my sound refuses to work now.....  >:(
Title: Re: The AI and You
Post by: GeoModder on November 07, 2011, 18:36:12
the bad news is my sound refuses to work now.....  >:(

Headset won't work?
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 09, 2011, 21:58:10
Sorry i took so long to state this, the sound came back alive for me.... ^^'

anyways, i looked at your edited version of my seventh mission Old Dragon, it's looking mighty good. :o

my only questions are:
1: why did you put the DefLocation in the Atrox system?
2: Can i play this in the editor as is?
Title: Re: The AI and You
Post by: The Old Dragon on November 09, 2011, 23:44:48
1) Oops, forgot to change it back  :P  When I first got your mission files, I had to create a new location for the mission as you hadn't uploaded your system file at that time... guess I over-looked the changing it back to your original bit.

2) Aside from the above, it should play as is without any crash errors, just the issue with the raptors running away. The file I uploaded is the 'mod' that I created to test & work your mission script.
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 12, 2011, 04:17:15
Alright, im about to test it out myself. As that saying goes 'two heads are better than one'...  ;)
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 12, 2011, 04:32:15
Ok.... before i even got to your changes i ran into some problems.

1) the raptors dont even budge now.

2) raptor 'trap' isnt sprung when player ships are close enough to Nav point.

on a side note:

3) already solved the location problem, just a little bit of the ''<--- BACKSPACE'' button was necessary, since you had the original location still written in the document.

4) carried the files over into an 8th mission (YOUR edit of the Atlantis mission) if you ever need an original of one of the files, just let me know and ill gladly let you download it.
Title: Re: The AI and You
Post by: The Old Dragon on November 12, 2011, 13:38:20
Hi SMT,

Will soon have that sorted, currently working on the Raptor AI.

One thing I have noticed at this point is that the raptors aren't capable of taking down the Angelwings shields... maybe you'll want to look into balancing that later
Title: Re: The AI and You
Post by: The_Small_Time_Modder on November 26, 2011, 06:01:36
Old Dragon:

sorry i have not replied in a LONG time. but i finally have some things on my campaign updated.

heres the link again.

http://arparso.de/nexus/forum/index.php/topic,342.msg2412.html#new (http://arparso.de/nexus/forum/index.php/topic,342.msg2412.html#new)

on a side note: i cant believe this topic is nearing it's 100th reply... THIS IS CRAZY! :D
Title: Re: The AI and You
Post by: The Old Dragon on December 02, 2011, 01:06:52
Hi SMT,

Give this a whirl, both Raptor and Gorg AI's are done and appear to work well (or at least as intended). You might want to look into balancing things out a little though, the Raptors don't last too long and the Gorgs need more anti hull weapons to make them a threat.

Regards,

The Old Dragon