unable to create ship

Home Forums Mods and POG Scripting unable to create ship

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #14456
    TheCoredump
    Participant

    Please help :p
    I don’t try to do something special. I am just trying to make a mission via the scenario function. But I am unable to create any ship except the player ship.
    Here is my code of the main task handler. As you see it is very, very, very, very simple.
    But why the Hell the instructor_ship won’t show up ?!?


    task MissionHandler ()
    {
    hstate state;
    hsim start_waypoint;
    hsim weapons_waypoint;
    hemail ehandle;
    htask mission_task = Task.Current();
    hship player_ship;
    hship instructor_ship;

    debug Debug.PrintString("MissionHandlern");

    atomic
    {
    // get the mission state
    state = State.Find( mission_task );
    if ( !state )
    {
    // if it doesnt exist create a state and set up the global for this mission
    state = State.Create( mission_task, MS_Start );

    start_waypoint = iUtilities.CreateWaypointRelativeTo ( iMapEntity.FindByName ( "Lucrecia's Base" ), 24 km, 0, 0 );

    player_ship = iShip.Create( "ini:/sims/ships/player/DreadnaughtCorvette", "Dreadnaught" );
    Sim.PlaceRelativeTo ( player_ship, start_waypoint, 0, 0, 0 );
    iShip.InstallPlayerPilot( player_ship );

    instructor_ship = iShip.Create( "ini:/sims/ships/navy/old_corvette", "Instructeur" );
    iPilotSetup.GenericMilitary( instructor_ship );
    iSim.SetFaction( instructor_ship, iFaction.Find( "Navy" ) );
    Sim.PlaceRelativeTo ( instructor_ship, start_waypoint, 5000, 0, 0 );

    }
    }
    iGame.EnableBlackout( false );
    }

    Thanks in advance for your help

    TheCoredump


    TheCoredump

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.