Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
42 user(s) are online (19 user(s) are browsing Forum)

Members: 0
Guests: 42

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: -100€
(last updated 09/2018)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 77 users playing Freelancer on 33 servers.
September. 25, 2018

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



Tutorial. Safe using of Single Player scripts in MultiPlayer
Not too shy to talk
Joined:
2010/6/13 13:38
From Russia, Penza
Group:
Registered Users
Posts: 96
Offline
IN ADVANCE -- SORRY FOR MY BAD ENGLISH!!!

Let's begin. We know enough about problems with SP scripts in online.
1. Duplicating of script instances by every player.
2. Duplicating of storyinfo inside player file.
3. Wrong working with "Player" variable.

We can avoid this! But we need to learn my rules.

Rule 1. Do not write anything inside NewPlayer file!

In basic tutorial of SP in online recommended to activate Mission 13 in NewPlayer file. Don't do this! FL trying to resave StoryInfo with current mission state, but forget about removing previos.

But how activate storyline scripts without it?

You can activate it by GenericMission. Example from Freelancer BETA:

[StoryInfo]
Mission = GenericMission, \missions\tutorial\tutorial.ini
MissionNum = 0
delta_worth = -1
debug = true

GenericMission have bug. If you run script and SP and resave it - FL will lost this mission and will save "GenericMission" without link to any script. We can use it! If FL will try to resave StoryInfo, he will trying to save not working mission!

That's all! FL can't active broken GenericMission and we can forget about duplicates - anyway they will be non-working.

Remember - with GenericMission you can use any script in any location. Forget about default 13 missions - create new scripts!

But how write this strings to Player file? Use Restarts!

Rule 2. Use only ONE SP instance at the same time.

Example. You are admin and want to create event. You will be "team leader".
- create restart file with activated story script
- use this restart
- done! mission activated

Any next logging of player can reset "Player" variable inside script. But this will not corrupt activated SP instance.

In total. Mission activated. Without duplicates. And new player logins will not corrupt it.

Remember - you can use only 1 mission type at the same time. Second mission (different mission script) will ignored by FL.

Rule 3. Use single player scripts only for spawning, destroying and reaction of it (running fuses, spawning new NPC, etc).

You can't use dialogs, objectives and thn-scrupts. More than it - server will crash after trying to run thn script.

But how to run THN scripts? You can use THN inside some bases. For example, on landing or launching. Players won your event and will land on victory base. After dock they will see cutscene "thank you, this applause for you!" or "you beat Nomad City and seeing last hypergate scene from mission 13". You can everything - just do it.

You can't use friendly NPC with fomations - Player variable changes after any player logging in.
You can't change reputation of NPC. To set reputation use restarts or setreps of your FLHook or FLShell. (but you still can change reputation between spawned NPCs)

And... that's all! Simple 3 rules and now you can create any event on your server. More interactive with active spawn of special NPCs and without any programming.

But I can't did this event in MP... because I have not enought players. FL is dead and that's wery big problem for run this events...

Anyway. That's only tool. And that's working.

Posted on: 4/7 21:04

Edited by Jeider on 2018/4/7 21:53:14
Edited by Jeider on 2018/4/7 21:54:56
Edited by Jeider on 2018/4/8 8:08:18
Edited by Jeider on 2018/4/8 8:15:30
Top
Re: Tutorial. Safe using of Single Player scripts in MultiPlayer
Home away from home
Joined:
2008/9/11 15:55
From Somewhere at Moscow
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 1716
Offline
Instead of restarts binary patch for saving SP things is needed.
But how about Dynamic Missions plugin?

Posted on: 4/11 11:43
Open Sirius Mod
Top
Re: Tutorial. Safe using of Single Player scripts in MultiPlayer
Not too shy to talk
Joined:
2010/6/13 13:38
From Russia, Penza
Group:
Registered Users
Posts: 96
Offline
Quote:
Instead of restarts binary patch for saving SP things is needed.

Needed for... what? SP things is not required to save. You have event > You start event (by restart) > Event completed > SP mission is completed (by Act_ChangeState in last trigger). SP deactivated and don't distrub anyone.

Quote:
But how about Dynamic Missions plugin?

You about adoxa's plugin? Plugin working in MP, and SP scripts will not hurt it.


Posted on: 4/19 23:33
Top
Re: Tutorial. Safe using of Single Player scripts in MultiPlayer
Home away from home
Joined:
2008/9/11 15:55
From Somewhere at Moscow
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 1716
Offline
"You about adoxa's plugin?"
As i remember - W0dka's plugin with M0tah's support

Posted on: 6/27 10:50

Edited by HeIIoween on 2018/6/27 11:01:26
Open Sirius Mod
Top