Welcome to Open Carnage

A resource for Halo 1 modding and tech, with unique means of rewarding individual content creation and support. Have a wander to see why we're worth the time! EST. 2012

Sign in to follow this  
Followers 0

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.

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.


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


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);

ProtonCacheFile cacheFile = map.ToCacheFile();


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.