Modifications of mission.lvl only on server side causes player crash

Started by Fluffy, April 11, 2016, 06:42:55 AM

Previous topic - Next topic
Hey !
Now i'm finally able to do modifications of server manager files, i want to create a special gamemode on coruscant : jedi vs clones. So i'm recoding the conquestion clone vs csi of coruscant map, but there's a first problem appearing to me.



On this picture, you can see at left a clean mission.lvl and on the right part, this is my modification in the mission.lvl...If i test this mission.lvl during a game in solo, it works the riffleman diseappears and is no longer choosable. But if connecting players haven't the modified file if the server is the only one to have the "new" mission.lvl, it causes the crash of anyone connecting player...So my question is what modifications in mission.lvl are possible to do without creating crash for players who haven't got modifications ? So first, does my idea is realizable or everybody f this server must have "new" mission.lvl file ? I heard on my last help post, with the tutorial (https://www.gametracker.com/games/swbf2/forum.php?thread=86800), that is possible to mod only server, to have a different server than another. But at the end, we can read, with this method all of modifications can't be feasible, and the rest must be done with mods & maps...But it rejoins my initial question, how can i know what is realizable in server, or only with tools mod ? Certains server where i played last week have modifications, as example, on jabba's palace, hero of csi is a gammorrean. So i know it's possible but how ....
Sorry for my bad english (i'm french :/), and if you have any questions, or if wasn't clear for any points, please tell me =)
Thanks in advance...

When changing units like this, all players must have the mission.lvl mod when they join the game.  The server is calling a unit that the player does not have loaded.  If anyone were to spawn as that unit, the client and server would have a mismatch, which causes a crash.

The only solution, with this method, is to have everyone download your mission.lvl if they want to join.

For Jabba's Palace, the Gamorreans are already part of the mission.lua (natives).  So, switching them does not introduce an error, because the client can still find the unit that the server wants and produce it upon request.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Yes, just to say again what Dark Phantom has mentioned:

not all server file edits will work for clients.

It is fortunate that any work at all.

This board describes all the mods we know for the server for SWBF1:
http://www.swbfgamers.com/index.php?board=69.0

and these will also likely work for SWBF2
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

So if i understood correctly, if i want a new unity, in clones side, during coruscant clone vs csi conquest, this unity must be loaded base on this map. As example, replace an assassin droid with an assassin clone, it can be possible ? However replace an assassin droid with a jedi master or an acklay, it's imposible ? Is it right ?

Right, sides that are already loaded during the map can be made available.  Like both sides clones with work (with only a server modification).  But clone vs empire will not work since they are not already loaded on the map.
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Ok thanks and for the hero, is it the same thing ? Mace Windu can be replacable with darth maul ? I think that is possible, but darth maul couldn't be replacable with jango fett, han solo or even Grievous ? Same thing for heroes than units of side, or not at all ?

I am not familiar with the SWBF2 heroes, but any hero that is called on the map can be made playable on either side.

For SWBF1, we have Luke (rebels) and Vader (empire).    I can make Vader playable on the empire side or rebel side and Luke playable for the rebel side or empire side by putting them into the player slots. 

I could not make Mace Windu playable for empire (without a download) since he is called in the other era.
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

I just got you message on Gametracker but see you solved it already. At the time of putting those little guides together, that's all I understood how to do. At this point I would recommend learning how to use the mod tools. The mod tools comes with all of the original map scripts and you can edit them and compile a new mission.lvl file. It's way more freedom than hex editing the old file.
Never let a person named AnthonyBF2 touch your BF2.

Ok, it is just that I wanted to understand how works the server and his modifications. Later I know that we can make many more things with the mod tools, but that has for constraint to impose downloads him. It has for constraint to impose on all the players to download a .lvl file. While I who wish to open a modded server on gameranger but where everybody can join without having to make the slightest manipulation or the slightest download. Thus it is important for me to understand that I CAN make side server only and what what i CANNOT be made without the mod tools. Obviously I am going to put myself in it because he interests me but not for the moment =)

I, along with another user by the name of PyroJockey did server side modding for a good long time. We've determined just about everything that you can do on server side that will not crash or require downloads. But there is too many things to make a list so if you ever need help on a specific thing PM me and I'll help you with it. PyroJockey and I are pretty deep in the server side stuff.  :tu:
Never let a person named AnthonyBF2 touch your BF2.

Quote from: Led on April 11, 2016, 06:19:58 PM
I am not familiar with the SWBF2 heroes, but any hero that is called on the map can be made playable on either side.

For SWBF1, we have Luke (rebels) and Vader (empire).    I can make Vader playable on the empire side or rebel side and Luke playable for the rebel side or empire side by putting them into the player slots. 

I could not make Mace Windu playable for empire (without a download) since he is called in the other era.
Quote from: Plaigon on April 11, 2016, 06:42:55 AM
Hey !
Now i'm finally able to do modifications of server manager files, i want to create a special gamemode on coruscant : jedi vs clones. So i'm recoding the conquestion clone vs csi of coruscant map, but there's a first problem appearing to me.
I don't mod SWBF2 LUA but it's probably the same as SWBF1. Each side LVL has the main REQ file and then the unit REQ files.
ReadDataFile calls on the unit REQs, these can't be changed without using a mission.lvl mod or it will crash. It loads all the unit ODFs from the specified unit REQs into the game memory.
AddUnitClass calls on which unit ODF to spawn, this can be changed without crash, as long as the units exist in the REQs called by ReadDataFile. This is why you can add heros that are already called on to the other team.

Sometimes the REQ branches only have one unit with the same name for AddUnitClass like the darktrooper for example
ReadDataFile("SIDE\\IMP.lvl",
"imp_inf_dark_trooper");
AddUnitClass(IMP, "imp_inf_dark_trooper",10)

This is more difficult to change with a hex editor than by modding the mission LUA, so I don't recommend that method for such mods. But if you're editing a mod map without the mission source, you can check the LUA bytecode to find munged numerical values using Tirpider's method http://www.swbfgamers.com/index.php?topic=5677.msg56449#msg56449

Ok thanks to all for your very good answers, but i'm actually reading the swbf2 scripting system (https://sites.google.com/site/swbf2modtoolsdocumentation/battlefront2_scripting_system) and i saw the concept of events. But i don't quite understand, how can i modify result of event ? As example can i modifiy the result of CharacterDeath to spawn a gamorrean guard at the same location of the killed character ? And above all where are the files managing theses events ? I think it's the mission.lvl, isn't it ? And again the same question, are these modifications of event result are possible only on server side and realizable without causing crahs to all connecting players on my server ? I think of course it depends that what i want to do in this events, as example, create a spwn of a creature in a certain event, it's possible, but it must be a creature already loaded, as we saw earlier in this post, no ? My goal actually, is to modify result of CharacterDeath event, only if it's a player who is the killed character, and if it's possible the result would be a spawn of a creature, to see more the spawn function. Thanks in advance and sorry if this question seems stupid, i am a beginner =)