Welcome to Open Carnage

A resource for gamers and technology enthusiasts, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

Kavawuvi

Chimera (build 49)

187 posts in this topic

You could just switch FP arms gbxmodel dependancy in globals.globals depending on player's current biped, I think that could work. I made FP hands switching for revolution maps using very hacky ways of scrolling textures and it's not the most efficient way of doing it but it worked.

ST34MF0X likes this

08f9474ede.jpg

Share this post


Link to post
Share on other sites

Members of Open Carnage never see off-site ads.

Been keeping my eye on this, and I have to say that this extension is awesome.

 

I have one question, however. How does one go about compiling a lua script into their .map file? 

 

Keep up the great work 002! 

Share this post


Link to post
Share on other sites
54 minutes ago, Nickster5000 said:

Been keeping my eye on this, and I have to say that this extension is awesome.

 

I have one question, however. How does one go about compiling a lua script into their .map file? 

 

Keep up the great work 002! 

 

For compiling, you can compile the Lua script if you want to, but it's not required to insert into a map. To compile, you'll need to run luac on your Lua script. While there are several advantages for doing so (slightly shorter load times and prevent users from tampering with your script), your script will only work for the Lua version and architecture you used with luac. For more information, check here: https://www.lua.org/manual/5.3/luac.html

 

For loading it into a map file, the Lua script can be inserted into the map file using a tool I wrote, or it can be loaded if it's found in the chimera_lua folder. The latter part is useful for testing.


status.png?customhost=ProtonNebula.com:1

status.png?customhost=ProtonNebula.com:2

status.png?customhost=ProtonNebula.com:2

competent.png

Share this post


Link to post
Share on other sites
On 9/15/2017 at 4:04 AM, aLTis said:

You could just switch FP arms gbxmodel dependancy in globals.globals depending on player's current biped, I think that could work. I made FP hands switching for revolution maps using very hacky ways of scrolling textures and it's not the most efficient way of doing it but it worked.

I believe this is even easier to accomplish with something like OS and it's project yellow system, where you can set up global-explicit, or scenario-explicit references in the form of a .tag_collection, where you would include the fp .gbxmodel tags themselves, and then could use a method involving lua scripting to swap the model out as you would see fit.

 

I'm not sure how this would be performed specifically, but Nickster says this would be done by finding the memory address for fp arms in the globals tag, and then swap them out with the fp models referenced in the .tag_collection associated with a project yellow tag, or something along those lines.

Share this post


Link to post
Share on other sites

If anyone wants to play around with the current version of the Lua scripting thing I wrote for Chimera, here's what you'll need:

 

Chimera build -363 (to be able to use Lua scripts): chimera build -363.7z

 

Lua API information: https://docs.google.com/document/d/1noKt8eTJE_8ozxT_RSbBYx2PPciw5hYOdxLgTm9fSyM/ (note that this is updated as I add functions and by the time you download -363, you will most likely have an outdated version of the Lua scripting API)

 

chimera_ltool.exe (for inserting Lua scripts into map files): chimera_ltool.7z

 

 

If you want some example maps:

 

boardingaction_grav_6.7z (Boarding Action with reduced gravity between the ships, as well as gravity that pulls towards the ships rather than just straight down)

set_callback("tick","OnTick")

clua_version = 1.0

abs = math.abs

MIDDLE = 10
DISTANCE = 9

function OnTick()
    for i=0,2047 do
        local object = get_object(i)
        if object then
            local x_coord = read_f32(object + 0xA0)
            local velocity = read_f32(object + 0x70)
            local z_coord = read_f32(object + 0xA8)
            if x_coord > MIDDLE - DISTANCE and x_coord < MIDDLE + DISTANCE and z_coord > -6.0 and velocity ~= 0.0 then
                local difference = abs(MIDDLE - x_coord)
                local scale = (1 - (difference / DISTANCE)) * 0.85 + 0.15
                if difference < DISTANCE * 0.15 then
                    scale = 0.95
                end
                local grav_scale = 1.0
                if read_u16(object + 0xB4) == 5 then
                    local tag_data = read_u32(get_tag(read_u32(object)) + 0x14)
                    grav_scale = read_f32(tag_data + 0x1CC)
                end
                
                if z_coord > 10.0 and velocity > -0.01 then
                    scale = scale * (20.0 - z_coord)/20
                    if scale < -0.15 then scale = -0.15 end
                end
                
                write_f32(object + 0x70, velocity + 0.003665 * scale * grav_scale)
                
                if difference > 2.0 then
                    local x_velocity = read_f32(object + 0x68)
                    local x_scale = (1 - (difference / DISTANCE)) * 0.85 - 0.15
                    if x_scale < 0 then x_scale = 0
                    elseif x_coord < MIDDLE then
                        x_scale = x_scale * -1
                    end
                    write_f32(object + 0x68, read_f32(object + 0x68) + x_scale * 0.003665 * grav_scale)
                end
            end
        end
    end
end

 

pacmanthing_1.7z (a Pac-Man maze where the hallway in the middle maintains relative position and momentum when an object crosses it)

set_callback("pretick","OnTick")

clua_version = 1.0

SIDE_A = 59.988
SIDE_B = 80.388
DIFF = math.abs(SIDE_B - SIDE_A)

function OnTick()
    for i=0,2047 do
        local object = get_object(i)
        if object then
            local otype = read_u16(object + 0xB4)
            local owner = read_u32(object + 0x11C)
            if otype < 6 and owner == 0xFFFFFFFF then
                local x = read_f32(object + 0x5C)
                if x < SIDE_A then
                    write_f32(object + 0x5C, x + DIFF)
                elseif x > SIDE_B then
                    write_f32(object + 0x5C, x - DIFF)
                end
            end
        end
    end
end

 

Tucker933 and aLTis like this

status.png?customhost=ProtonNebula.com:1

status.png?customhost=ProtonNebula.com:2

status.png?customhost=ProtonNebula.com:2

competent.png

Share this post


Link to post
Share on other sites

Hello! I've been watching from a distance for quite some time. 

Firstly, I just want to say that this mod is absolutely fantastic! You have managed to fix one of the longest standing gripes I and many others have had for the longest of time. Thanks to you, we can enjoy playing Halo Custom Edition with buttery smooth animations. It's like a new game. 

Thank you so much for your contribution! You're awesome, and I can't wait to see what all you come up with, moving forward!

I just have a couple of questions: Are you still working on the server-side Chimera functionality? If so, is there a rough ETA as to when server admins can start deploying said functionality?


Founder and current project lead of the TiaraCE project.

Share this post


Link to post
Share on other sites
20 minutes ago, ST34MF0X said:

I just have a couple of questions: Are you still working on the server-side Chimera functionality?

Yes.

 

Quote

If so, is there a rough ETA as to when server admins can start deploying said functionality?

Not at the moment. Currently I'm only working with one group for testing the server stuff, and this is because of the nature of how these updates work.

 

If you need to know what's going on, I'm currently working on getting vehicles going. Controlling the vehicles is smooth as butter and has little to no warping whatsoever - a great improvement over stock Halo. However, vehicles other players are controlling are a little worse than stock aside from the fact that they don't warp now. There's a bit of jitteryness going on, mainly.

 

As for bipeds, they're much better than stock aside from slight jitters that may happen on occasion, and this is mostly mitigated by interpolation. Player control feels exactly or close to exactly like hosting the game yourself in LAN, except now you have analog movement if you decide to use a controller. You can do tricks like nade jumping and you'll be fine as long as you have a decent connection.

ST34MF0X likes this

status.png?customhost=ProtonNebula.com:1

status.png?customhost=ProtonNebula.com:2

status.png?customhost=ProtonNebula.com:2

competent.png

Share this post


Link to post
Share on other sites

Thanks for the quick reply! 

I can definitely see the benefits of your approach. For one, it mitigates the utterly insane number of server-side related bug reports and user-error related "issues" you would be bombarded with, and I would assume makes developing these features easier and as stress-free as possible.

At any rate, I'm looking forward to trying these features out, once deemed ready for the public eye. Until then, I wish you the best of luck.

May the winds of fortune move in your favor.

Edited by ST34MF0X
Kavawuvi and Tucker933 like this

Founder and current project lead of the TiaraCE project.

Share this post


Link to post
Share on other sites

heres a simple velocity changer that I wrote:

clua_version = 1.0;
set_callback("tick", "OnTick");
adjustedSpeed = false;
player = nil;
velocityMultiplier = 5;
playerSpeed = nil;
function OnTick()
    
    local object = get_player();
    
    if object ~= nil then
    
        if adjustedSpeed == false then
    
            playerSpeed = read_float(object + 0x6C);
            
            write_float(object + 0x6C, playerSpeed * velocityMultiplier);
            adjustedSpeed = true;
        end
    else
--        cout("object is returning nil");
    end
end

very neat work 002! loving how this is coming along! 

Share this post


Link to post
Share on other sites

I forgot to mention that with Chimera's lua scripting, if you create a folder called chimera_lua in your -path folder (by default, the My Games\Halo CE folder), then you can put Lua scripts in here without having to insert them into your map. The filename is the same as the map name, but instead it ends with .lua. Note that if Chimera detects a script in here, then it will load this instead of the script in the map file.

 

There's also an unlisted command, chimera_reload_lua, which can be used to reload the Lua script without the need to reload the map.

Tucker933, Sceny and ST34MF0X like this

status.png?customhost=ProtonNebula.com:1

status.png?customhost=ProtonNebula.com:2

status.png?customhost=ProtonNebula.com:2

competent.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.