PDA

View Full Version : Mission scripting


Nikolai
20 February 2004, 06:03 PM
Hi everyone

Buda 5 is really a great mod and I've had much fun with it so far.
So keep the good work up. :)

So now my little question:
Since Buda5 doesn't feature any missions I tried to
code one myself. I ran into various problems while
doing so, but the most important one is that
whenever I try to run a very basic mission I-War
crashes.

So maybe someone here can tell me what I'm doing wrong.

The problematic line is this one
>> iShip.InstallPlayerPilot( player_ship );

where player_ship is defined as
>> hship player_ship = iShip.Create("ini:/sims/ships/player/comsec_prefitted", "Test");

Does this InstallPlayerPilot need any special definition?

Ok, thanks in advance.

Nikolai

(I can post the *.pogs here, if you should need them)

Roi Danton
21 February 2004, 01:23 PM
The basic way for creating a player ship is this:


hship player;

player = iShip.Create( inifile of the ship, name );

iShip.InstallPlayerPilot( player );
iSim.SetFaction( player, player's faction );
//for finish the scenario when player ship is destroyed (otherwise it spins around)
Object.SetStringProperty( player, "death_script", "iDeathScript.PlayerDeathScript" );

What scripts do you use as reference?

Roi Danton
21 February 2004, 01:25 PM
Hey, just recognized you're from Dresden too! :) Where do you live here?

Nikolai
21 February 2004, 07:04 PM
What scripts do you use as reference?

I only have the ones that come with the EoC SDK.
So I tried to modify the challenge_course pog to just
start the game and set the player ship somewhere.

I attached my pog files, maybe you can find the mistake I'm making.
raiders.pog is the gui
mission1.pog is the mission which should be started from the
gui, maybe the starting bit is already wrong. Since I get no debugging
output after the game crashes I can't really tell.


Hey, just recognized you're from Dresden too! Where do you live here?

In Reick, near the "Saturn" electronics store.

Roi Danton
22 February 2004, 04:40 PM
Haven't the time to test your scenario (exams), but following to the code itself:

You've used the lineiGame.SetGameType( IGT_Mod );
iGame.StartNewGame( "map:/geog/badlands/hoffers_wake", "act0" );
For starting an own scenario, better use an custom name (for example: "mission1").

I never used an atomic function at startup, so maybe it causes the crash. You needn't it b/c there won't be any inteference with another task. Also read this:SDK Reference
If a code in an atomic block were to get stuck in an infinite loop it would lock up the game.

For debugging output use the debug pkg like you did at the part "Finding the reference locations". The debug msg appears at the file flux.log. Due to overview reason by reading that file use a specified name for the debug msgs of your scenario. Example: debug Debug.PrintString( "BUDA5 InfiniteWar: STARTED\n" );

Nikolai
22 February 2004, 08:22 PM
All right, I found the problem.

It was
iGame.StartNewGame( "map:/geog/badlands/hoffers_wake", "mission" );

"mission" has to specify a valid .pkg file from which mission.main is called.

Btw., good luck with your exams.

Nikolai

Roi Danton
23 February 2004, 06:15 PM
Originally posted by Nikolai
All right, I found the problem.

Btw., good luck with your exams.Fine and thx! :)

Btw: If you're interested, the German Firstones Forum you can find here (http://forums.firstones.com/forumdisplay.php?s=&forumid=31).