Help with a mission script
-
Did you guys found a solution against multiactivating of the missions? Every login the .fl file grows with new [StoryInfo] parameters.
How exactly do you activate spawning just by one player? I tried a lot in the past 5 hours, but every of my char will spawn objects or no char spawns anything.A solution would be to create a small extern program to remove every [StoryInfo] entry except one in every fl file, so no multiplicating is possible.
By the way, if you set Mission_13 to be No_Mission, it does’nt activate anything.
[StoryInfo]
ship_bought = false
Mission = Mission_13
MissionNum = 41
delta_worth = -1.000000
debug = 0 -
I have the same problem with this multiactivating.
-
try #26 - this must switch mission to no_mission
-
@ skotty - I use FLHook plugin version and i make a restart.fl with this at the bottom:
[StoryInfo]
ship_bought = false
Mission = Mission_13
MissionNum = 0
delta_worth = -1.000000
debug = 0or
i use mpnewcharacter.fl once at the start of a server restart and delete
[StoryInfo]
ship_bought = false
Mission = Mission_13
MissionNum = 41
delta_worth = -1.000000
debug = 0before another script can start.
-
Just to give a quick update:
I think ive stopped the multi-spawning of npcs and bases using mission code only (no flhook required).
I’ll do some more tests, but so far is so good!
If all goes well i will post the code, if people want it.
Testing the server without flhook, flshell or anything of the like, just plain old freelancer (with the 1.1 patch).p.s - with this method it is easy to spawn ships, bases etc but it wont act like some kind of single player mission in multi-player.
I guess its main use would be to add objects, bases, npcs etc without a client needing a mod. -
This thread got me trying out mission scripting. So far I’ve managed to make NPCs spawn as well as Solars, even a dockable base in SP by experimenting with code here and in the SDK mission files. The main thing that bothered me about this was that the solars and NPCs vanished when I jumped out and returned to the system they were in. Will Solars vanish in MP if a player leaves the system they’re in, or do they persist in-game and this is just a problem with SP?
-
khayman wrote:
I think ive stopped the multi-spawning of npcs and bases using mission code only (no flhook required).Will you also tell us what you did? Just making people curious is nasty :-x
-
Khayman nice! Very nice that you did it without any hook
-
@ Xalrok - Yeah the spawned bases/objects will stay there in multiplayer. (its actually part of the issues were having)
After further tests of this, i can report it is NOT as fixed as i thought… Yes, it does stop the multi-spawning of ships, but there is a downside…
When the server starts, the first account (not character) starts the script running… that account will start the script. Any other players that join the session can see and interact with the spawned stuff, without actually spawning more.
If the first account player swaps to another “new character” (on the same MPID) then that new character will again spawn according to the script.
Also, if the first account on the server leaves the session, the next player to join the server will start a script. (meaning its again possible to spawn x2 of anything)
So, with this method its only ok if you start your server, create a character to start the script, then leave that character on the server. And if you wanted to play on your server from the same machine you would need to use another account MP-id. (i just used another user account on windows xp for tests)
My theory is with more work and possibly the mix of flhook starting scripts, it would work much better.
As for stopping or killing scripts… i guess that is the next step.Anyways,
For anyone that wants to see what i did, can try this out (this is just an example that spawns king near the tradelane outside manhatten)[Mission]
mission_title = 1
mission_offer = 1
reward = 4000
npc_ship_file = missions\m01a\npcships.ini[NPC]
nickname = ak_m01a
npc_ship_arch = MSN12_King
voice = king
space_costume = li_scrote_head, li_scrote_body, comm_li_hatcher
affiliation = fc_or_grp
individual_name = 217204[MsnShip]
nickname = khayman
NPC = ak_m01a
radius = 0
label = Khayman
label = allied[ObjList]
system = ALL
nickname = khayman_form_on_trent
SetPriority = ALWAYS_EXECUTE
Delay = 19
Follow = Player, 3000, -20, 0, 40[Trigger]
nickname = lets_start
system = Li01
InitState = ACTIVE
Cnd_CharSelect = true; <- WHEN YOU SELECT CHAR
Act_ForceLand = Li01_01_Base
Cnd_BaseEnter = Li01_01_Base
Cnd_SpaceExit = no_params
Act_NNIds = 30000, HISTORY
Act_NNIds = 30005, HISTORY
;Act_SetShipAndLoadout = ge_fighter6, khayman
Act_ActTrig = take_off_popup_open[Trigger]
nickname = take_off_popup_open
Cnd_LaunchComplete = Player
;Act_RPopTLAttacksEnabled = false
Act_Popupdialog = 60253, 21925, CLOSE
Act_ActTrig = take_off_popup_close
Act_NNIds = 30000, HISTORY
Act_NNIds = 30005, HISTORY[Trigger]
nickname = take_off_popup_close
Cnd_PopUpDialog = CLOSE
system = Li01
Act_SpawnShip = khayman, khayman_form_on_trent, -34321, 0, -25925, 0.780800, 0, 0.624700, 0
Act_Invulnerable = khayman, true, false, 0.950000
Act_SetVibe = khayman, Player, REP_FRIEND_THRESHOLD
Act_SetVibe = Player, khayman, REP_FRIEND_THRESHOLD
Act_MarkObj = khayman, 1
Act_DeactTrig = lets_start; <- TURN OFF INITIAL TRIGGER -
Checked FLHook 1.6.7 build 23 just for fun.
So, only one change is needed:
Freelancer\EXE\freelancer.ini : [Initial MP DLLs] path = ..\dlls\bin DLL = Content.dll, GameSupport, HIGHEST ; required to operate gates and docks ; required to create ships in space DLL = Content.dll, SpaceSupport, NORMAL DLL = Content.dll, BaseSupport, NORMAL DLL = Content.dll, StoryLauncher, BELOW_NORMAL ;story/static missions <------------- added this DLL = Content.dll, SpacePop, LOWEST ;populator DLL = Content.dll, AISandbox, BELOW_NORMAL DLL = Content.dll, TestAutomation, BELOW_NORMAL DLL = Content.dll, BasePop, LOWEST
Then run from FLHook console:
mission <playernickname></playernickname> ```or if you are admin from game chat:
.mission <playernickname></playernickname>
I do not know works for one player or group - so check
-
I dont think you need to add the story launcher.
Also, check this if you want to debug missions (I think Flak’s code is based on this): http://forge.the-starport.net/projects/flhookplugin/repository/show/trunk/plugins/dynamic_missions -
Ah thx, i saw…Will check. I remember that you shared by mission scripting knowledge with KJ
-
#26 fixed variant. Works even better
[Mission] npc_ship_file = missions\npcships.ini [MsnSolar] nickname = fp7base faction = li_p_grp reputation = li_p_grp system = LI01 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 = LI01 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 = LI01 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 = LI01 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 = ANY InitState = ACTIVE Cnd_True = no_params Act_Popupdialog = 999999, 999998, CLOSE Act_SetVibe = Player, Player, REP_FRIEND_MAXIMUM Act_MarkObj = Player, 1 Act_LockDock = Player, Li01_to_Li02, unlock Act_LockDock = Player, Li02_to_Li01, unlock Act_LockDock = Player, Li03_to_Li01, unlock Act_LockDock = Player, Li01_to_Li03, unlock Act_LockDock = Player, Li01_to_Li04, unlock Act_LockDock = Player, Li04_to_Li01, unlock Act_LockDock = Player, Li01_to_Li03_hole, unlock Act_LockDock = Player, Li01_to_Li04_hole, unlock Act_LockDock = Player, Li02_to_Li04_hole, unlock Act_LockDock = Player, Li03_to_Li01_hole, unlock Act_LockDock = Player, Li04_to_Li01_hole, unlock Act_LockDock = Player, Li04_to_Li02_hole, unlock Act_LockDock = Player, Li01_08, unlock Act_LockDock = Player, Li01_09, unlock Act_LockDock = Player, Dock_Ring_Li01_01, unlock Act_LockDock = Player, Li01_09, unlock Act_LockDock = Player, Iw03_02, unlock Act_LockDock = Player, Br02_to_Iw03_hole, unlock Act_LockDock = Player, Iw03_to_Br02_hole, unlock Act_LockDock = Player, Iw03_to_Li02, unlock Act_LockDock = Player, Li02_to_Iw03, unlock Act_LockDock = Player, Iw03_to_Br04_hole, unlock Act_LockDock = Player, Br04_to_Iw03_hole, unlock Act_LockDock = Player, Li04_to_Iw01, unlock Act_LockDock = Player, Li04_to_Iw02, unlock Act_LockDock = Player, Li04_to_Iw02_hole, unlock Act_LockDock = Player, Li03_to_Iw05, unlock Act_LockDock = Player, Li03_to_Iw05_hole, unlock Act_LockDock = Player, Li03_to_Iw06, unlock Act_LockDock = Player, Li03_to_Iw06_hole, unlock Act_LockDock = Player, Li02_to_Iw04, unlock Act_LockDock = Player, Li02_to_Iw04_hole, unlock Act_LockDock = Player, Iw01_to_Li04, unlock Act_LockDock = Player, Iw02_to_Li04, unlock Act_LockDock = Player, Iw02_to_Li04_hole, unlock Act_LockDock = Player, Iw04_to_Li02, unlock Act_LockDock = Player, Iw04_to_Li02_hole, unlock Act_LockDock = Player, Iw05_to_Li03, unlock Act_LockDock = Player, Iw05_to_Li03_hole, unlock Act_LockDock = Player, Iw06_to_Li03, unlock Act_LockDock = Player, Iw06_to_Li03_hole, unlock Act_LockDock = Player, Br03_to_Bw01_hole, unlock Act_LockDock = Player, Bw01_to_Br03_hole, unlock Act_LockDock = Player, Bw01_to_Br03, unlock Act_LockDock = Player, Br04_to_Br03_hole, unlock Act_LockDock = Player, Br03_to_Br04_hole, unlock Act_LockDock = Player, Br04_trade_lane_ring_4, unlock Act_LockDock = Player, bw01_01_dock_ring_1, unlock Act_LockDock = Player, osiris, unlock Act_LockDock = Player, Ku06_to_Bw05_hole, unlock Act_LockDock = Player, Bw05_to_Ku06_hole, unlock Act_LockDock = Player, Bw05_to_Rh01_hole, unlock Act_LockDock = Player, Rh01_to_Bw05_hole, unlock Act_LockDock = Player, Rh01_to_Rh04, unlock Act_LockDock = Player, Rh04_to_Rh01, unlock Act_LockDock = Player, Rh04_to_Rh05_hole, unlock Act_LockDock = Player, Rh04_to_Bw05_hole, unlock Act_LockDock = Player, Rh04_to_Bw05, unlock Act_LockDock = Player, Rh02_to_Rh04_holeb, unlock Act_LockDock = Player, Rh04_to_Rh02_holeb, unlock Act_LockDock = Player, Rh04_01_dock_ring, unlock Act_LockDock = Player, Rh04_01, unlock Act_LockDock = Player, Rh04_03, unlock Act_LockDock = Player, Rh04_02, unlock Act_LockDock = Player, Rh04_05, unlock Act_LockDock = Player, Rh04_05, unlock Act_LockDock = Player, Li01_to_Li05, unlock Act_LockDock = Player, Li05_prison_1, unlock Act_LockDock = Player, Li05_to_Li01, unlock Act_LockDock = Player, Li01_to_Li04_hole, unlock Act_LockDock = Player, Li04_to_Li01_hole, unlock Act_LockDock = Player, Li01_12, unlock Act_LockDock = Player, Li01a_to_Li01b_hole, unlock Act_LockDock = Player, Li01b_to_Li01a_hole, unlock Act_LockDock = Player, St02c_core_exit, unlock Act_LockDock = Player, St02_lair_exit, unlock Act_LockDock = Player, St02_to_St01_hole, unlock Act_LockDock = Player, St01_dock_ring_1, unlock Act_LockDock = Player, St01_to_St03_hole, unlock Act_LockDock = Player, Ku06_to_Ku07_hole, unlock Act_LockDock = Player, Ku01, unlock Act_LockDock = Player, Ku01_to_Ku04_hole, unlock Act_LockDock = Player, Ku04_to_Ku06_hole, unlock Act_LockDock = Player, St01_to_St02_hole, unlock Act_LockDock = Player, St01_to_St03_hole, unlock Act_LockDock = Player, St02_to_St01_hole, unlock Act_LockDock = Player, St03_to_St01_hole, unlock Act_LockDock = Player, Li05_to_Li01, unlock Act_LockDock = Player, Li01_to_Li05, unlock Act_LockDock = Player, Ku06_to_Ku07_hole, unlock Act_LockDock = Player, Ku07_to_Ku05_hole, unlock Act_LockDock = Player, Ku05_to_Ku07_hole, unlock Act_LockDock = Player, Iw03_to_Br04_hole, unlock Act_LockDock = Player, Br04_to_Iw03_hole, unlock Act_LockDock = Player, Bw01_to_br03_hole, unlock Act_LockDock = Player, Br03_to_br04_hole, unlock Act_LockDock = Player, Br03_to_bw01_hole, unlock Act_LockDock = Player, Br04_to_br03_hole, unlock Act_LockDock = Player, Br04_to_br05_hole, unlock Act_LockDock = Player, Br05_to_br04_hole, unlock Act_LockDock = Player, Bw05_to_Ku06_hole, unlock Act_LockDock = Player, Bw05_to_rh01_hole, unlock Act_LockDock = Player, Ku06_to_bw05_hole, unlock Act_LockDock = Player, Rh01_to_Bw05_hole, unlock Act_LockDock = Player, Rh02_to_Rh04_holeb, unlock Act_LockDock = Player, Rh04_to_Rh02_holeb, unlock Act_LockDock = Player, Li01a_to_Li01b_hole, unlock Act_LockDock = Player, Li01b_to_Li01a_hole, unlock Act_LockDock = Player, Br05_to_br04_hole, unlock Act_LockDock = Player, Br04_to_br05_hole, unlock Act_LockDock = Player, Br03_to_br04_hole, unlock Act_LockDock = Player, Br04_to_br03_hole, unlock Act_LockDock = Player, Bw01_to_br03_hole, unlock Act_LockDock = Player, Br03_to_bw01_hole, unlock Act_LockDock = Player, Ku06_to_bw05_hole, unlock Act_LockDock = Player, Bw05_to_Ku06_hole, unlock Act_LockDock = Player, Bw05_to_rh01_hole, unlock Act_LockDock = Player, Rh01_to_Bw05_hole, unlock Act_LockDock = Player, Rh04_to_Rh02_holeb, unlock Act_LockDock = Player, Rh02_to_Rh04_holeb, unlock Act_LockDock = Player, Li01_to_Li05, unlock Act_LockDock = Player, Li05_to_Li01, unlock Act_LockDock = Player, Li01a_to_Li01b_hole, unlock Act_LockDock = Player, Li01b_to_Li01a_hole, unlock Act_LockDock = Player, Ku05_to_Ku07_hole, unlock Act_LockDock = Player, Ku07_to_Ku05_hole, unlock Act_LockDock = Player, Ku06_to_Ku07_hole, unlock Act_LockDock = Player, Ku07_to_Ku06_hole, unlock Act_LockDock = Player, St01_to_St02_hole, unlock Act_LockDock = Player, St02_to_St01_hole, unlock Act_LockDock = Player, St01_to_St03_hole, unlock Act_LockDock = Player, St03_to_St01_hole, unlock Act_LockDock = Player, Hi02_to_Ew06_hole, unlock Act_LockDock = Player, Hi01_to_Ew05_hole, unlock Act_LockDock = Player, No01_to_Li17_hole, unlock Act_ActTrig = go_mis [Trigger] nickname = go_mis system = Li01 Cnd_SystemEnter = Li01 Act_ActTrig = mis_yes Act_ActTrig = mis_no [Trigger] nickname = mis_yes Cnd_HasMsn = yes Act_SetVibe = Player, Player, REP_FRIEND_MAXIMUM Act_MarkObj = Player, 1 Act_ActTrig = start_init [Trigger] nickname = mis_no Cnd_HasMsn = no Act_SetVibe = Player, Player, REP_FRIEND_MAXIMUM Act_MarkObj = Player, 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_end [Trigger] nickname = start_init system = li01 Cnd_Timer = 10 Act_RandomPop = true Act_RpopAttClamp = true Act_RpopTLAttacksEnabled = true Act_Destroy = freeport7_space_dome1, SILENT ; kill copies of solars (detroy root must be in fuse) Act_Destroy = freeport7_space_dome2, SILENT ; -//- 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_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 = Li01 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 = ANY Cnd_Timer = 1 Act_ChangeState = SUCCEED
Popup dialog = motd
-
Not bad server-side idea after 10y still…
mpnewcharacter.fl
:
... [StoryInfo] Mission = GenericMission, \missions\tutorial\tutorial.ini ;<< -- ex. restart templates by popup dialogs YES_NO_LATER MissionNum = 0 delta_worth = -1 debug = true [StoryInfo] ship_bought = false Mission = Mission_13 ;<<-- ex. motd window + wingman using npc around (but do not spawn anything = will broke all ) MissionNum = 0 delta_worth = -1.000000 debug = 0