0.1.2 Release
Key Information
Server OwnersAs of 0.1.2, the PlayerStreamDistance, VehicleStreamDistance, and CheckpointStreamDistance values in config.lua have been merged into one StreamDistance variable. The CellSize variable has been removed in favor of deducing it from the StreamDistance variable. If you have made changes to these variables, make sure to update your config appropriately, or it will use default values.
For example, the Streamer section of your config.lua may have looked like this (not including comments):
Streamer =
{
PlayerStreamDistance = 500,
VehicleStreamDistance = 500,
CheckpointStreamDistance = 500,
CellSize = 512
}
It should be changed to this:
Streamer =
{
-- The default distance before objects are streamed out.
-- Default value (in metres): 500
StreamDistance = 500
}
If you haven't changed the values, it is still advisable you update the Streamer section for compatibility.
Server Owners and ScriptersThis update will remove the FireRegisteredEvent, Register and Unregister functions that were deprecated as of 0.1.1. You
must remove these from your scripts to ensure that your scripts will run with 0.1.2.
All of the default scripts have been updated to fix this; if you are using them, you can copy them from the default_scripts folder or from
GitHub.
Otherwise, to manually update your scripts, simply find and replace "Events:FireRegisteredEvent" to "Events:Fire" and remove any lines with "Events:Register" and "Events:Unregister" in them, so that (for example) this script:
Events:Register( "JoinGamemode" )
Events:Subscribe( "JoinGamemode", JoinGamemode )
function SomeFunction( player )
Events:FireRegisteredEvent( "JoinGamemode", player )
end
Events:Unregister( "JoinGamemode" )
will become
Events:Subscribe( "JoinGamemode", JoinGamemode )
function SomeFunction( player )
Events:Fire( "JoinGamemode", player )
end
0.1.2 Changelog
Object SpawningUnleash the true potential of JC2-MP scripting!It's finally here! We've added the ability to spawn any model from the game, giving scripters an opportunity to massively extend Panau with their own crazy creations. The majority of JC2 models are spawnable; will you be the first to create a majestic city in the sky? Or will you be the first to create a stunt server filled with insane ramps and loops? The potential lies in your hands!
To help you find models for use on a server, Trix has put together a model viewer script for 0.1.2 which you can find
here. Please note it is meant for development purposes only; unless you're a scripter in need of models, don't run it on your server.
Work-in-progress documentation for object spawning can be found
here.
Highlighted ServersCheck out the servers of the week!We've noticed that some of the more exotic, interesting servers aren't getting all the attention they deserve; to help remedy this, we've chosen to highlight these servers and rotate through them on a regular basis. You can apply for your server to be highlighted
here.
To start off, we've decided to highlight the excellent
Battle for Panau and
Real Life servers as we feel these are an excellent example of how we'd like JC2-MP to develop going forward. Think you've got something equally as promising coming up? Let us know!
New Features Shared Reenabled Lua's debug functions
Removed Events functions: FireRegisteredEvent, Register and Unregister
Added (websafe) constants to Color
Added common vector constants
Added Transform2:Invert and Transform3:Invert
Added StaticObject, allowing you to spawn most objects from the game
Added an 'entity' field to Player:GetAimTarget which contains the player, vehicle or static object the player is aiming at
Server Replaced OGP with GameSpy4 query protocol, making it possible to connect to a server when Announce = false, as well as improving server stability
Added Player:GetIP
Unhandled packet warnings now print the source IP address
Added Console:Run under IKnowWhatImDoing, allowing scripts to run console commands
Added the PlayerWorldChange Lua event
Removed CellSize in config.lua; merged PlayerStreamDistance, VehicleStreamDistance and CheckpointStreamDistance into one StreamDistance variable
Client Added highlighted servers
Added BaseWindow functions SetWidth, SetHeight, GetWidth, GetHeight, RelativeToAbsolute and AbsoluteToRelative
Added Label functions GetTextSize and SetTextSize
Added TableRow functions (Get/Set) BackgroundEvenColor, BackgroundOddColor, BackgroundHoverColor, BackgroundEvenSelectedColor, BackgroundOddSelectedColor
Added the LocalPlayerWorldChange Lua event
Added BaseWindow:Subscribe with the events HoverEnter, HoverLeave, Focus, Blur, PreRender, Render, and PostRender
Added Render:SetClip
Added the MouseUp Lua event
Added Game:GetTime to get the time of the current world
Bug Fixes Shared Attempting to access invalid static Lua class variables now returns nil instead of erroring
Changed static gettable for Lua classes to also return instance methods; i.e. you can get Player.SendChatMessage without requiring an actual player
Fixed Vector2 and Vector3 default constructors having uninitialised components
Time is now properly synced across all worlds, not just DefaultWorld; clients also receive the time every 30 seconds to prevent drift
Server IKnowWhatImDoing now unlocks more, including os and io functions
Fixed crash on startup for Linux builds
Client Fixed a very prevalent crash related to invalid data being passed into JC2's landscape code
Fixed crash when unloading a module with a modal window
Player is now made vulnerable after disconnecting from a server
Fixed passing LocalPlayer through Events:Fire not working
Fixed (parent, name) GWEN constructors not applying the name
Changed default server browser sort to lowest ping
Fixed vehicles sometimes becoming invulnerable when being repaired
Fixed sometimes dying inside terrain after CalcView reenables the local player
Fixed Window:DisableResizing not working
Clamped font size from 0 to 512
Increased font size on main menu
Menu/console windows are now resized on resolution change
Changed GWEN Slider background line to white to improve visibility
Fixed ProgressBar:SetCycleSpeed not updating the auto label
Fixed BaseWindow:__eq being undefined
Fixed scrollbar being invisible in a GWEN Tree
Fixed infinite loop in GWEN when labels with word wrap are too small
Fixed labels with word wrap not being docked correctly
Fixed cursor not showing up for all corners of a window
Fixed crash when resizing JC2 before main menu
Fixed crash in InputAction::SetState hook
Fixed crash in Player::EnterSmartObject
Make sure to check out the highlighted servers! They're all set up on 0.1.2 and ready to go; both of them bring an entirely different experience to JC2-MP, and are definitely worth checking out.