The Starport
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord
  • Register
  • Login

MP Scripting Problems

Scheduled Pinned Locked Moved Speciality Modding
11 Posts 4 Posters 8.9k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xalrok
    wrote on global:last_edited_by,
    #1

    I’ve been trying out MP scripting recently and most of it seems to work, but there’s a few problems that I can’t figure out.

    Double spawns: Whenever I spawn a [MsnSolar] or [MsnShip] it always spawns a second copy for no reason. The copy is a clone of the original object with the same stats. Targeting the original object or the clone targets both at the same time. Sometimes several cloned objects can spawn. The cloned objects are often in the exact same coordinates as the original object but sometimes clones spawn that are offset from the original. (And to clarify, I start up FLServer, launch FL, make a brand new character and use a restart to trigger the script so it’s probably not to do with logging in twice.)

    Solars immediately destroyed: Basically anything with “destructable = true” and hitpoints like the Dyson generators or the d_depot used by Benford station spawn with 0 hitpoints immediately and behave as if they’re destroyed. There’s no triggers calling for them to be destroyed, just for them to spawn.

    What causes these? I think I’ve seen the double spawns happening in videos before. I’ve no idea why the solars are destroying immediately either.

    1 Reply Last reply
    0
  • K Offline
    K Offline
    khayman
    wrote on global:last_edited_by,
    #2

    Ok, this a is tough subject and alot can depend on the code of the script… without seeing any of the code i can only give suggestions from my tests.

    Xalrok wrote:
    I’ve been trying out MP scripting recently and most of it seems to work, but there’s a few problems that I can’t figure out.

    (And to clarify, I start up FLServer, launch FL, make a brand new character and use a restart to trigger the script so it’s probably not to do with logging in twice.)

    Make sure that your restart to the mission is not in the same system as the new player spawn i.e Li01. What i mean is if your new players start on manhattan make sure your mission doesn’t start in New York.

    Solars immediately destroyed: Basically anything with “destructable = true” and hitpoints like the Dyson generators or the d_depot used by Benford station spawn with 0 hitpoints immediately and behave as if they’re destroyed. There’s no triggers calling for them to be destroyed, just for them to spawn.

    This only happened to me when i used Act_ChangeState = SUCCEED i think
    if not you could try making them indestructable with the mission script, like…
    Act_Invulnerable = name_of_solar_here, true, false, 0.950000
    Im running a little server that is using missions scripts at the moment, In my script i use this.

    Also, after tests i found that i had to clean the player files all the time too.

    Hope any of this helps,
    Khayman.

    1 Reply Last reply
    0
  • X Offline
    X Offline
    Xalrok
    wrote on global:last_edited_by,
    #3

    Ok, this a is tough subject and alot can depend on the code of the script… without seeing any of the code i can only give suggestions from my tests.

    This is what I’m using. It’s slightly modified from this thread.

    [Mission]
    npc_ship_file = missions\npcships.ini
    
    [MsnSolar]
    nickname = fp7base
    faction = li_p_grp
    reputation = li_p_grp
    system = PR01
    base=intro1_base
    position = 3600, 1000, -6000
    orientation = 1, 0, 0, 0
    archetype = freeport7
    loadout = freeport7
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    
    [MsnSolar]
    nickname = freeport7_space_dome1
    faction = li_p_grp
    reputation = li_p_grp
    system = PR01
    position = 4118, 1000, -6000
    orientation = 0, 0, 1, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    loadout = space_dome
    
    [MsnSolar]
    nickname = freeport7_space_dome2
    faction = li_p_grp
    reputation = li_p_grp
    system = PR01
    position = 3080, 1000, -6000
    orientation = 1, 0, 0, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    loadout = space_dome
    
    [MsnSolar]
    nickname = freeport7_space_dome3
    faction = li_p_grp
    reputation = li_p_grp
    system = PR01
    position = 3600, 1000, -5609
    orientation = 1, 0, 1, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    loadout = space_dome
    
    [Trigger]
    nickname = tr_initialize_init
    system = PR01
    InitState = ACTIVE
    Cnd_True = no_params
    Act_ActTrig = go_mis
    
    [Trigger]
    nickname = go_mis
    system = PR01
    Cnd_SystemEnter = PR01
    Act_ActTrig = start_init
    
    [Trigger]
    nickname = start_init
    system = PR01
    Cnd_Timer = 10
    Act_RandomPop = true
    Act_RpopAttClamp = true
    Act_RpopTLAttacksEnabled = true
    Act_SpawnSolar = fp7base
    Act_SpawnSolar = freeport7_space_dome1
    Act_SpawnSolar = freeport7_space_dome2
    Act_SpawnSolar = freeport7_space_dome3
    Act_MarkObj = fp7base, 1
    Act_MarkObj = freeport7_space_dome1, 1
    Act_MarkObj = freeport7_space_dome2, 1
    Act_MarkObj = freeport7_space_dome3, 1
    

    I did change some things around, such as moving the script out of the system where new players spawn. I also tried starting the initialization in one system and spawning the solars in another one on entering it, although this had the same problems I mentioned in the first post.

    Once I got the bases to spawn and not destroy themselves by having the restart move me to a third system not referenced by the mission, but then they were spawning in that system when they shouldn’t. In all cases they spawned doubles.

    Also, sometimes the script would break FL, causing major FPS lag and the server load to go red.

    1 Reply Last reply
    0
  • K Offline
    K Offline
    khayman
    wrote on global:last_edited_by,
    #4

    Sorry i’m not 100% sure, i really don’t have time to start testing this while trying to maintain mine at the same time.

    as suggestions you could try,
    instead of starting the mission script on a /restart template, add it to the player.fl file and beam your character to the system that starts the mission.

    instead of using a timer to spawn your stuff, maybe try when something happens so that the script moves on from the spawn… like a pop up window and/or some history.
    maybe try moving the code around abit and de-activate used triggers.

    i am adding the mission info to mpnewcharacter.fl then removing it when the script is loaded, then deleting the account that started the script and deleting any mission info from player files at server intervals.

    1 Reply Last reply
    0
  • W Offline
    W Offline
    w0dk4
    wrote on global:last_edited_by,
    #5

    Double spawns

    This is a known problem with this method of multiplayer scripting. From some debugging I did a while ago, a new mission is spawned everytime a player logs in, so if you login 5 times, 5 missions will run etc…

    1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    wrote on global:last_edited_by,
    #6

    At the end of EXE\mpnewcharacter.fl:

    ...
    [MissionState]
    mission_accepted = 1 ; yes we have mission
    att_clamp = true
    tradelane_attacks = true
    scan_clamp = true
    gcs_clamp = false
    hostile_clamp = false
    random_pop = true
    
    [BStoryMissionDone]
    
    [StoryInfo]
    ship_bought = false
    Mission = Mission_01a
    MissionNum = 0
    delta_worth = -1.000000
    debug = 0
    
    

    Inside DATA\MISSIONS\M01A\m01a.ini

    [Mission]
    npc_ship_file = missions\npcships.ini
    
    [MsnSolar]
    nickname = fp7base
    faction = li_p_grp
    reputation = li_p_grp
    system = FP7_system
    base=intro1_base
    position = 3600, 1000, -21000
    orientation = 1, 0, 0, 0
    archetype = freeport7
    loadout = freeport7
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    random_name = true
    
    [MsnSolar]
    nickname = freeport7_space_dome1
    faction = li_p_grp
    reputation = li_p_grp
    system = FP7_system
    position = 4118, 1000, -21000
    orientation = 0, 0, 1, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    random_name = true
    loadout = space_dome_co_01
    parent = fp7base
    
    [MsnSolar]
    nickname = freeport7_space_dome2
    faction = li_p_grp
    reputation = li_p_grp
    system = FP7_system
    position = 3080, 1000, -21000
    orientation = 1, 0, 0, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    random_name = true
    loadout = space_dome_co_01
    parent = fp7base
    
    [MsnSolar]
    nickname = freeport7_space_dome3
    faction = li_p_grp
    reputation = li_p_grp
    system = FP7_system
    position = 3600, 1000, -20609
    orientation = 1, 0, 1, 0
    archetype = freeport7_space_dome
    label = lbl_fp7base
    radius = 0
    pilot = setscene_nomad_fighter_FP7
    random_name = true
    loadout = space_dome_co_01
    parent = fp7base
    
    [Trigger]
    nickname = tr_initialize_init
    system = FP7_system
    InitState = ACTIVE
    Cnd_True = no_params
    Act_ActTrig = go_mis
    
    [Trigger]
    nickname = go_mis
    system = FP7_system
    Cnd_SystemEnter = FP7_system
    Act_ActTrig = mis_yes
    Act_ActTrig = mis_no
    
    [Trigger]
    nickname = mis_yes
    Cnd_HasMsn = yes
    Act_ActTrig = start_init
    
    [Trigger]
    nickname = mis_no
    Cnd_HasMsn = no
    Act_RandomPop = true
    Act_RpopAttClamp = true
    Act_RpopTLAttacksEnabled = true
    Act_Destroy = freeport7_space_dome1, SILENT ; kill copies of solars
    Act_Destroy = freeport7_space_dome2, SILENT ; detroy root must be in fuse
    Act_Destroy = freeport7_space_dome3, SILENT ; -//-
    Act_Destroy = fp7base, SILENT ; -//-
    Act_SpawnSolar = fp7base
    Act_SpawnSolar = freeport7_space_dome1
    Act_SpawnSolar = freeport7_space_dome2
    Act_SpawnSolar = freeport7_space_dome3
    Act_MarkObj = fp7base, 1
    Act_MarkObj = freeport7_space_dome1, 1
    Act_MarkObj = freeport7_space_dome2, 1
    Act_MarkObj = freeport7_space_dome3, 1
    Act_SetVibe = fp7base, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome1, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome2, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome3, Player, REP_HOSTILE_THRESHOLD
    Act_ActTrig = the_end
    
    [Trigger]
    nickname = start_init
    system = FP7_system
    Cnd_Timer = 1
    Act_RandomPop = true
    Act_RpopAttClamp = true
    Act_RpopTLAttacksEnabled = true
    Act_Destroy = freeport7_space_dome1, SILENT ; kill copies of solars
    Act_Destroy = freeport7_space_dome2, SILENT ; detroy root must be in fuse
    Act_Destroy = freeport7_space_dome3, SILENT ; -//-
    Act_Destroy = fp7base, SILENT ; -//-
    Act_SpawnSolar = fp7base
    Act_SpawnSolar = freeport7_space_dome1
    Act_SpawnSolar = freeport7_space_dome2
    Act_SpawnSolar = freeport7_space_dome3
    Act_MarkObj = fp7base, 1
    Act_MarkObj = freeport7_space_dome1, 1
    Act_MarkObj = freeport7_space_dome2, 1
    Act_MarkObj = freeport7_space_dome3, 1
    Act_SetVibe = fp7base, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome1, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome2, Player, REP_HOSTILE_THRESHOLD
    Act_SetVibe = freeport7_space_dome3, Player, REP_HOSTILE_THRESHOLD
    Act_ActTrig = the_end
    
    [Trigger]
    nickname = the_end
    system = FP7_system
    Cnd_SystemEnter = FP7_system
    Cnd_Destroyed = fp7base, 1, EXPLODE
    Cnd_Destroyed = freeport7_space_dome1, 1, EXPLODE
    Cnd_Destroyed = freeport7_space_dome2, 1, EXPLODE
    Cnd_Destroyed = freeport7_space_dome3, 1, EXPLODE
    Act_ActTrig = the_end_end
    
    [Trigger]
    nickname = the_end_end
    system = FP7_system
    Cnd_SystemEnter = FP7_system
    Cnd_Timer = 1
    Act_ChangeState = SUCCEED
    
    

    Last time i have checked my improved dedublication method - works.
    Hope this helps 😄

    1 Reply Last reply
    0
  • X Offline
    X Offline
    Xalrok
    wrote on global:last_edited_by,
    #7

    I looked at Khayman’s Restart Order Mission Script and based my mission off of that. I also used mpnewcharacter.ini and all the instant self-destructs and double-spawns went away. I spawned a Dyson Sphere and Lair with all their shields and generators without any problems. I also made Osiris spawn when you docked on a station.

    Then I tried using a restart and the double spawns reappeared. So I used FLCodec to decode the player file to see what was happening and found this:

    [StoryInfo]
    ship_bought = false
    Mission = Mission_12
    MissionNum = 0
    delta_worth = -1.000000
    debug = 0
    [StoryInfo]
    ship_bought = false
    Mission = Mission_12
    MissionNum = 0
    delta_worth = -1.000000
    debug = 0
    

    So it seems that when I use a restart it runs the same mission twice at the exact same time, which would explain why triggers after the initial mission start caused double spawns.

    Edit: Also, mpnewcharacter wasn’t spawning a mission either when I tested the above restart.

    1 Reply Last reply
    0
  • K Offline
    K Offline
    khayman
    wrote on global:last_edited_by,
    #8

    Helloween is your best bet on this one, because you have used his coding method it seems.
    My coding is a little different, pop on to my server and have a look or check out this video:

    Here

    If you want to see my scripts, just let me know.

    1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    wrote on global:last_edited_by,
    #9

    My example works only if your player starts from FP7 system.

    So currently i understand that if you start from mpnewplayer - all is ok.

    If you start from restart - not ok?

    1 Reply Last reply
    0
  • X Offline
    X Offline
    Xalrok
    wrote on global:last_edited_by,
    #10

    HeIIoween wrote:
    My example works only if your player starts from FP7 system.

    So currently i understand that if you start from mpnewplayer - all is ok.

    If you start from restart - not ok?

    Yeah, it seems to be like this. Maybe it’s that I’m using the wrong restart plugin (the one that’s with Disco 4.86, built into playercntl I think.)

    This is what I found:
    mpnewcharacter.ini = Mission script works normally.

    Use a /restart = Seems bugged, starts the same mission twice.

    And also this this:
    Make a new character -> use a /restart (but don’t log back into the character when it kicks you from the server) -> restart the FLServer program -> login to the character, mission script works normally.
    But that way is tedious.

    1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    wrote on global:last_edited_by,
    #11

    At the Disco this hack is applied:

    content.dll 04EE3A A22A->A26A = OpenSP tweak for 1.1 DLLs to always start from m13
    ```So change your mission to Mission = Mission_13
    and move your scripts into m13.ini
    1 Reply Last reply
    0

  • Story Mission level requirement
    C
    CommanderArgelo
    0
    11
    52

  • Crash Offsets
    J
    josbyte
    0
    231
    251.4k

  • Capital ships shield collision detection
    C
    CommanderArgelo
    0
    3
    17

  • Dropping a phantomloot cargo from an NPC
    C
    CommanderArgelo
    0
    5
    26

  • Incorrect Shield Value on HUD
    C
    CommanderArgelo
    0
    4
    19

  • @Adoxa - Wheel Scroll plugin improvements
    AingarA
    Aingar
    0
    3
    20

  • Release: Advanced Renderer v. 1.1 beta 1
    S
    SWAT_OP-R8R
    3
    50
    428

  • German Mod Tutorials? 2024 Mod Tutorial?
    S
    SWAT_OP-R8R
    0
    18
    66
  • First post
    Last post
0
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord