March 29, 2024, 13:26:15

Author Topic: The AI and You  (Read 80171 times)

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #50 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.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #51 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?
« Last Edit: October 02, 2011, 04:16:00 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: The AI and You
« Reply #52 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...
Better to look the fool by asking, then prove them right with ignorance.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #53 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.
« Last Edit: October 02, 2011, 21:42:46 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #54 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?
« Last Edit: October 02, 2011, 22:15:29 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #55 on: October 03, 2011, 00:20:00 »
Take a look at what I wrote here, 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

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: The AI and You
« Reply #56 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).

Better to look the fool by asking, then prove them right with ignorance.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #57 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...  >:(
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #58 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);

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: The AI and You
« Reply #59 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.
Better to look the fool by asking, then prove them right with ignorance.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #60 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
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #61 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?

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: The AI and You
« Reply #62 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?
Better to look the fool by asking, then prove them right with ignorance.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #63 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

Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: The AI and You
« Reply #64 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.

Better to look the fool by asking, then prove them right with ignorance.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #65 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...
« Last Edit: October 08, 2011, 19:44:29 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #66 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 ...>
« Last Edit: October 08, 2011, 19:48:32 by Mularac »

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #67 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...  ;)
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #68 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.
« Last Edit: October 09, 2011, 19:22:22 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #69 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
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #70 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.

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #71 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?
« Last Edit: October 14, 2011, 00:05:08 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #72 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?

Offline The_Small_Time_Modder

  • Petty Officer
  • **
  • Posts: 126
  • Karma: 0
  • Watch out batman! here comes CHUCK NORRIS!
    • View Profile
Re: The AI and You
« Reply #73 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);
);
« Last Edit: October 15, 2011, 23:26:48 by The_Small_Time_Modder »
Epic win = when bullets dodge YOU.

Nothing can contend with that. Unless if you can travel through time and space.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: The AI and You
« Reply #74 on: October 16, 2011, 00:01:10 »
I'm not seeing the call to the gorg machine here...