Issues with your account? Bug us in the Discord!
Mission scripting
Nikolai
Trainee
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)
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)
Comments
[code]
hship player;
player = iShip.Create( [i]inifile of the ship[/i], [i]name[/i] );
iShip.InstallPlayerPilot( player );
iSim.SetFaction( player, [i]player's faction[/i] );
//for finish the scenario when player ship is destroyed (otherwise it spins around)
Object.SetStringProperty( player, "death_script", "iDeathScript.PlayerDeathScript" );[/code]
What scripts do you use as reference?
Hey, just recognized you're from Dresden too! :) Where do you live here?
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.
[QUOTE]Hey, just recognized you're from Dresden too! Where do you live here?[/QUOTE]
In Reick, near the "Saturn" electronics store.
You've used the line[code]iGame.SetGameType( IGT_Mod );
iGame.StartNewGame( "map:/geog/badlands/hoffers_wake", [b]"act0"[/b] );[/code]
For starting an own scenario, better use an custom name (for example: [b]"mission1"[/b]).
I never used an [i]atomic[/i] function at startup, so [i]maybe[/i] it causes the crash. You needn't it b/c there won't be any inteference with another task. Also read this:[quote][i]SDK Reference[/i]
If a code in an atomic block were to get stuck in an infinite loop it would lock up the game.[/quote]
For debugging output use the [i]debug[/i] pkg like you did at the part "Finding the reference locations". The debug msg appears at the file [b][I]flux.log[/i][/b]. Due to overview reason by reading that file use a specified name for the debug msgs of your scenario. Example:[code] debug Debug.PrintString( "BUDA5 InfiniteWar: STARTED\n" );[/code]
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
[B]All right, I found the problem.
Btw., good luck with your exams.[/B][/QUOTE]Fine and thx! :)
Btw: If you're interested, the German Firstones Forum you can find [url=http://forums.firstones.com/forumdisplay.php?s=&forumid=31]here[/url].