No announcement yet.

Onset 1.7.0-alpha

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

    Onset 1.7.0-alpha

    Onset 1.7.0-alpha (Protocol Compatibility 8)

    Client changelog
    • New Lua functions
      • SetSound3DLocation(sound, x, y, z), GetSound3DLocation(sound)
      • IsGameDevMode()
      • GetPlayerEquippedWeaponSlot()
      • GetObjectModelName(ModelId) (needs testing)
      • GetPlayerForwardVector(player), GetPlayerRightVector(player), GetPlayerUpVector(player)
      • GetPlayerName(player)
      • AddPostProcessMaterial(SlotName, UMaterialInterface), RemovePostProcessMaterial(SlotName)
      • SetControlRotation(pitch, yaw, roll)
    • Add SetObjectTexture(object, texturefile, materialslot)
      Path layout: "packagename/folder/T_MyTexture.png"
      Image width and height should be a power of two (for GPU performance), 128x128, 256x256, 1024x1024, etc
      Image width and height should be the same (for GPU performance)
      Material slot depends per object mesh. But 0 should be the main slot most of the time.
    • Add SetObjectAnimatedTexture(object, texturefile, rows, columns, materialslot)
      Path layout: "packagename/folder/T_MyFlipbookTexture.png"
    • Add SetObjectColor and SetObjectEmissiveColor
    • GetPlayerWeapon(slot) now behaves the same way as on the server. As a third parameter it returns the rounds in the magazine.
    • Add event OnSteamOverlayActivated(bActivated) (needs testing)
    • Add event On*NetworkUpdatePropertyValue(id, PropertyName, NewPropertyValue)
    • Add event OnPlayerSwitchCamera(bIsFirstPerson). With the new clothing system I can no longer detect what clothing parts to hide during first person. You will have to use the new API to do that yourself.
    • Add bSpectateCamera to GetCameraLocation
    • Get*PropertyValue will now return nil instead of false if a property value does not exist or the entity identifier does not exist.
    • Add createtable_ex to create tables with metatables, replaces setmetatable. (@JanHolger) Due to the OOP in the new Lua Engine API I can no longer guarantee that setmetatable is safe.
    • Further improve Discord Rich Presence. Showing the Onset logo and the server IP when you hover it. When started with -dev it will show "Developing" instead of "Playing". The details will show "servername_short" from the server config.
    • SMG03 firing animation now also moves the charging handle.
    • Play correct helicopter pilot animation for helicopter seat 1.
    • Add Steam Rich Presence. Please test if the "Join" button on a players Steam profile works.
    Click image for larger version  Name:	SteamRichPresence.JPG Views:	0 Size:	8.5 KB ID:	626
    • Files downloaded from the server will stay in the same order as defined on the server (@JanHolger)
    • Add crouch walk aim animations for handguns and rifles!
    • Stop shooting when starting to fall.
    • Stop aiming when EnableFirstPersonMode is called.
    • Disable reload and equip while playing custom animation.
    • Settings save game file name now contains version suffix to prevent crashes in future changes.
    • Add body masks. Body parts will no longer leak from under the clothing items. See examples in the new API on how to use them.
    Click image for larger version  Name:	BodyMaks.JPG Views:	0 Size:	76.5 KB ID:	629
    • Add new policeman & hat outfit
    Click image for larger version  Name:	Onset_Police_Outfit.png Views:	0 Size:	735.5 KB ID:	627
    • Add Taser (subject to improvement in the next update)
    Click image for larger version  Name:	Onset_Taser.JPG Views:	0 Size:	32.3 KB ID:	628

    Second half of the pine wood town added

    Click image for larger version  Name:	SecondHalfOfTown1.JPG Views:	1 Size:	130.6 KB ID:	630
    Click image for larger version  Name:	SecondHalfOfTown2.JPG Views:	1 Size:	126.2 KB ID:	631

    Unreal Engine Lua Wrapper

    While thinking about a good API naming for the new clothing system I came to the conclusion that there is only a single satisfying solution.
    Onset will now wrap classes and functions from Unreal Engine into Lua!

    What does that mean?
    Onset will provide you a Lua API that directly maps to the classes and functions from the Unreal Engine. It means you can basically do whatever Unreal can do.

    What are the advantages?
    As for the new clothing system it means that I don't have to write dozens of generic Lua functions that basically all do the same like "SetPlayerHairModel", "SetPlayerShirtModel".
    This also paves the way for endless possibilities on modding. For example you can now also replace materials/textures on vehicles.

    Do I need to use this API?
    No, it's optional and it works perfectly fine with the "old" API. In fact you can also directly use the Unreal functions on entities from the old API.

    What about the "old" API?
    You can see this Lua Wrapper as an addition to the current system. For example you can use GetPlayerSkeletalMeshComponent to get a reference to the players body mesh. Then you continue with the new API to load a new mesh and set it to the player.

    Clothing system example. Clothing models are "Skeletal Meshes" in Unreal. You can directly load models by specifying their path. A list of models will be added to the wiki.

    local SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Body")
    SkeletalMeshComponent:SetMaterial(3, UMaterialInterface.LoadFromAsset("/Game/CharacterModels/Materials/HZN_Materials/M_HZN_Body_NoShoesLegsTorso")) // Mask to hide feet, legs and torso.
    SkeletalMeshComponent:SetFloatParameterOnMaterials("PupilScale", 1.3) // Make the pupil size big so it looks like the player is on drugs
    SkeletalMeshComponent:SetColorParameterOnMaterials("Skin Color", FLinearColor(0.239583, 0.239583, 0.239583, 0.0)) // Set brownish color.
    SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Clothing0")
    SkeletalMeshComponent:SetColorParameterOnMaterials("Hair Color", FLinearColor(2.0, 0.0, 0.0, 0.0))
    SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Clothing1")
    SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Clothing4")
    local DynamicMaterialInstance = SkeletalMeshComponent:CreateDynamicMaterialInstance(0)
    DynamicMaterialInstance:SetColorParameter("Clothing Color", FLinearColor(0.786458, 0.103145, 0.0, 1.0))
    SkeletalMeshComponent:SetRelativeScale3D(FVector(1.0, 1.01, 1.0))
    SkeletalMeshComponent:SetRelativeRotation(FRotator(0.0, 0.0, 0.0))
    SkeletalMeshComponent:SetRelativeLocation(FVector(0.0, 0.0, 0.0))
    As you can see it uses OOP. This is the best way and also necessary due to Unreal's class inheritance.

    What Unreal functions are available?
    Starting with this version I have began to wrap some of Unreals "component" classes as well as loading textures and materials from the game's pak file system.
    I will add a list of classes and their functions shortly.

    Server changelog
    • SetPlayerWeapon has a new parameter "bLoaded" to have the magazine loaded.
    • GetPlayerWeapon now returns from 1 instead of 0
    • Add "servername_short" setting (length limit 128 chars) to server_config.json
    • Remove SetObjectTexture, SetObjectAnimatedTexture, SetObjectColor (see client changelog)
    • Remove Set/GetPlayerModel (see client changelog for new clothing system)
    • Remove ResetPlayerCamera (use client function: SetCameraLocation(0.0, 0.0, 0.0, false))
    • Get*PropertyValue will now return nil instead of false if a property value does not exist or the entity identifier does not exist.
    • Dynamic loading of packages is now possible!
      -> StartPackage, StopPackage, IsPackageStarted
      -> Files will be downloaded automatically by the client
      -> When stopping a package timers will be destroyed automatically and the respective events and C++ plugin functions will be called.
      -> The server or client will not cleanup any entities that you have spawned. You got to handle that yourself in OnPackageStop.