Nexus Modding > Scripting

The AI and You

<< < (15/20) > >>

Mularac:
put a debug line inside the loop, something like


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

--- End 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.

The_Small_Time_Modder:
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: --- ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);

--- End code ---

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?

Mularac:
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: ---ExecList(M.GorgFleet,HideShip(S.this));
Dump(M.GorgFleet);

--- End code ---

to:


--- Code: ---ExecList(M.GorgFleet,Disappear(S.this));
Dump(M.GorgFleet);

--- End code ---

Also, what does the dump command show in the game console?

The_Small_Time_Modder:
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: ---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 code ---

Mularac:
I'm not seeing the call to the gorg machine here...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version