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!

Sign in to follow this  
Followers 0
Kavawuvi

Reflexive addition in Halo PC without HEK

23 posts in this topic

I had forgotten Sparkedit does this for adding new items to the scenario.

How it does it is laziness. It doesn't rebuild the map, it just overwrites data, which puts some maps at risk of being broken or having things like console commands being disabled as a result.


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

Members of Open Carnage never see off-site ads.

I know that. Sparkedit does it, too.

thatsthejoke.jpg

I was being facetious man, talking tongue-in-cheek. I wasn't presenting a report for review. Of course it's been done by all sorts of things, obviously your way is going to be better than using hmt and notepad. I was just saying we did it ages ago using the most ridiculous of methods, that was all.

 

Ryx and NeX like this

Share this post


Link to post
Share on other sites

Here's adding 100 rocks in a perfect circle. The count can be adjusted in the code, but you get the point. Code for it is in spoiler

Screen%20Shot%202015-03-13%20at%2010.35.

Download: http://protonnebula.com/proton/circlerockgulch_1.map.7z

 

char *data;

// Data is defined somewhere.

ProtonMap map(data);

const uint16_t size = 72;

char reflexiveToAdd[size] = {};
float x = 83;
float y = -151;
float z = 8;
*(uint16_t *)(reflexiveToAdd + 0x2) = 0xFFFF;

ProtonTag *tag = map.tags.at(map.principal_tag).get();

uint32_t count = 100;
float radius = 5.0;

HaloMapReflexive *reflexive = (HaloMapReflexive *)(tag->Data() + 0x210);
uint32_t offset = reflexive->address - tag->tag_magic;
uint32_t oldcount = reflexive->count;

for(uint32_t i=0;i<count;i++) {
    *(float *)(reflexiveToAdd + 0x8) = x;
    *(float *)(reflexiveToAdd + 0xC) = y + radius * sin((float)i / (float)count * M_PI * 4);
    *(float *)(reflexiveToAdd + 0x10) = z + radius * cos((float)i / (float)count * M_PI * 4);
    tag->InsertData(offset + (oldcount + i) * size, reflexiveToAdd, size);
}

reflexive = (HaloMapReflexive *)(tag->Data() + 0x210);
reflexive->count+=count;

ProtonCacheFile cacheFile = map.ToCacheFile();

Screen%20Shot%202015-03-13%20at%209.55.1


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
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.