Page 1 of 1

Mission.lvl Help

Posted: Wed Dec 17, 2014 10:23 pm
by Legitosity
Good evening guys!

My name is Zach, although I go by Legitosity online. I'm currently trying to create a (simple?) mod for my server! I've never done any swbf2 modding, but I know the basics of coding. I work with HTML5/CSS and Javascript, so even though I don't know Lua I can follow along. I'm trying to setup my server as a TDM server, and we're using the CTF maps. I'd also like to learn how to do this for the future, so by all means if you're feeling up to it go for modding it, but teach me! :)

I want to --

1.) Delete the flag (and if that's easy perhaps the score's at the top and the flag spawn location (the little glowy circle thing))

2.) Delete the vehicles

3.) Get rid of the spawn timer (Instant Spawn instead of waiting up to 15 seconds)

With the help of SWBFGamers I've been able to mess around with the coding alittle bit on my own, but I got directed over here because you concentrate on SWBF2. I downloaded a Mission.Lvl editor from their site and I've slowly been working around that.

(Here's the DL link for the editor http://www.mediafire.com/download/9dirn ... _swbfii.7z)

Let's use Mygeeto as an example map (there is CTF and Vehicles on this map so I can learn how to edit both out)

In the /scripts/MYG I opened up "myg1g_ctf.lua" in NotePad++ and then proceed to edit what I could find.

I found the spawn time

"SetSpawnDelay(10.0,0.25)" and changed it to "SetSpawnDelay(1.0,0.25)"

I also commented out all of the "flag capture objective stuff"

Image

and I commented out the vehicles in ReadDataFiles

Image

In my head, the logic is that I deleted the set position for the flags so they won't be places, I also deleted the ReadDataFile so the vehicles won't be there either aaand I lowered the spawn time to one so.

After than I go back to the root of the folder and hit munge, it munges a new mission.lvl

Then to test my mod, I run a new dedicated server off of my own computer (so I don't have to mess around with out actual server just yet) but when I hit start I get a FATAL message "Could not open MISSION\myg1g_ctf.lvl"

I'm obviously doing something wrong, :P

Thanks for helping in advance ~

- Legit

Re: Mission.lvl Help

Posted: Wed Dec 17, 2014 10:36 pm
by Noobasaurus
While I'm not particularly familiar with server modding, I do know that the 15 second spawn timer is hardcoded into the exe. The spawn timers you found in the script are for the AI I believe. Your error arises when the mission.lvl is either corrupted or not found.

Re: Mission.lvl Help

Posted: Wed Dec 17, 2014 11:11 pm
by Legitosity
Noobasaurus wrote:While I'm not particularly familiar with server modding, I do know that the 15 second spawn timer is hardcoded into the exe. The spawn timers you found in the script are for the AI I believe. Your error arises when the mission.lvl is either corrupted or not found.
Well, I didn't know that so I'm glad you told me! I'd probably be searching for a long time.....

I do have an exe from SWBFGamers with the fast spawn, but I thought I could also do it in the scripts

Now I just have to find the flag and the vehicles..

Re: Mission.lvl Help

Posted: Wed Dec 17, 2014 11:50 pm
by AnthonyBF2
1) The spawn timer is hard coded in the exe, you need the VA patched exe for instant spawn.
editing that little code on the map scripts does nothing.

2) removing tanks can be done without making mods, open any tank map file in hex editor and use the find+replace function and do this
com_item_vehicle_spawn becomes com-item-vehicle-spawn, do this for each instance of com_item_vehicle_spawn - this makes the game look for com-item-vehicle-spawn which doesn't exist, making tanks not work.

3) You can also remove flags using hex edit on the existing files
open the map file in hex editor, and search for com_item_flag, and between what looks like "XFRM0" and "PROP" there is about 50 bytes of data - obscure this data by writing just random letters and numbers over it (don't overwrite xfrm0 and prop, just the data in between those bits)
those little bytes of data is object coordinate and changing it puts the flag somewhere only god knows.

For 2 flag levels, do this for each instance of the flag you find. Usually f3 in hex tools finds next instance.

Re: Mission.lvl Help

Posted: Thu Dec 18, 2014 4:20 am
by Legitosity
Thank you Anthony! That was really helpful

I grabbed a patch from SWBF2Gamers for the Instant Spawn and was able to edit out the tanks/flags

Although the flag animation still appeared on my map just outside of the reachable region. So maybe I just need to type in more random variables? Why can't I just do the same thing for the tanks though com-item-flag?

And sorry to be a bother, but I'm wanting to learn for myself. Where would I find what to edit in the .exe?

Thank you very much though!!

Re: Mission.lvl Help

Posted: Thu Dec 18, 2014 2:34 pm
by AnthonyBF2
You can hex replace com_item_flag, but moving the location is what I used to do.

Re: Mission.lvl Help

Posted: Fri Dec 19, 2014 3:25 pm
by Legitosity
Do you know the line of code that controls the spawn timer though?

Is there a way to change it to any time that I want?

Re: Mission.lvl Help

Posted: Fri Dec 19, 2014 7:47 pm
by AnthonyBF2
Sketchup explained to me about locating the 2 address(team 1 spawn and for team 2) that control spawn timer using Cheat Engine. It's hellish hard to do(I'm not a very good CE user)

But you can control what you want the spawn to be at some point.
If I recall faintly, you have to select scan type to "value between..." and value type "float"
and type in the two boxes 0 and 15 (or 1 and 15?). and keep clicking "next scan" as the timer decreases and repeats. If you find it, you would be looking a 2 address where the number constantly drops from 15 and repeats, simply freeze them when they're under 1 (but freeze before 0 resets to 15)
Then when frozen, you can put what you want for value.

This is all I can remember, CE gives me a head ache.