Welcome to Open Carnage

A resource for Halo Custom Edition and MCC modding, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

EST. 14th of February, 2012

Nickster5000

Member
  • Content count

    24
  • Joined

  • Last visited

  • Raffle Tickets

    5

About Nickster5000

Extra Information

  • Gender
    Male

Recent Profile Visitors

998 profile views
  1. Preface: If you're comfortable with Lua's MetaTable system, and are comfortable with Lua's prototype inheritance chain, then feel free to scroll down to the bottom of this post for the full implementation. For those who haven't worked with Lua's prototype system, metatables allow you to expand the functionality of an object by defining metamethods. Normally, if you try accessing a value in an object, and it does not exist, then it will return nil. That's not entirely true: It will first check the __index metamethod to see if it can find the value in there. If it can't find the value in __index, THEN it will return nil. This allows you to create multiple unique objects that conform to a class schema. Motivation Let's say you needed to have some stuff occur concurrently in the background for your project. For instance, you want to implement a class system (I.E, DPS, Tank, Healer, Etc.) and you want to give them all "abilities" that last x amount of seconds, and have to cool down for y seconds. You could probably use something like w8 x to allow the ability to run, and do the same for w8 y to execute the cooldown. There's two problems to this though: 1. It blocks the function that it is called in. 2. What if you want to do stuff during these times? Like tell the user that their ability has 5 seconds left, or that their cooldown for an ability ends in another 10 seconds? That simply will not work. So, I've taken a bit of inspiration from JavaScript, and I implemented a pseudo-EventQueue system for SAPP. EventItem Class If you've already peeked at the implementation, you'll notice that EventItem has three methods you can call. Let's go over them and see how they work: EventItem:new() function EventItem.new(self) ... end This returns a new object with the __index metamethod being set to EventItem. Basically, you can use all of the operations and values from EventItem on this new object. EventItem:set() function EventItem.set(self, props, eachTickCb, completedCb, time) ... end This allows you to set some values for your EventItem. Let me explain what each parameter does: time - The amount of time you want this event to last, in ticks. If you want this event to last for 30 seconds, then time should be 900 (30 * 30). If you set the time to be -1, this is a conditional event, and will only terminate once eachTickCb returns true. props - place any values in here that you want this EventItem to have access to. completedCb - Did you know that lua functions are first class citizens in lua? That allows you to treat them like a value. Simply define a function and reference it, or define the callback function directly in this parameter spot. This function is called when the event is completed. The props parameter is automatically passed into it when it is called. eachTickCb - This function is executed on every tick. This function is called with two parameters: props and time. This will execute on every tick, and allows you to do stuff while the event is counting down (I.E, display that status message from earlier). EventItem:isTimedOut() function EventItem.isTimedOut(self) ... end This function has no parameters, but it is important that you understand what it does: If you set the event with a finite time, then it decrements that time by 1 for every tick, and executes the eachTickCb until time is zero. When time is zero, the completedCb is executed. If you set the event for -1 time, then it will execute the eachTickCb until it returns true, in which it will then execute the completedCb. This allows you to queue events that are related to different things other than time. Full Implementation EVENT_TABLE = {} EventItem = { time=nil, completedCb=nil, eachTickCb=nil, props=nil } function EventItem.isTimedOut(self) if self.time == -1 then --conditional event if self.eachTickCb == nil and self.eachTickCb(self.props, self.time) self.completedCb(self.props) return true end return false elseif self.time == 0 then -- timed event expires self.completedCb(self.props) return true else --timed event has not expired self.time = self.time - 1 if self.eachTickCb ~= nil then self.eachTickCb(self.props, self.time) end return false end end function EventItem.set(self, props, eachTickCb, completedCb, time) self.time = time self.props = props self.completedCb = completedCb self.eachTickCb = eachTickCb end function EventItem.new(self) local newEventTableInstance = {} setmetatable(newEventTableInstance, self) self.__index = self return newEventTableInstance end function OnScriptLoad() ... other callback definitions register_callback(cb['EVENT_TICK'], "handleTick") end function handleTick() for key,_ in pairs(EVENT_TABLE) do if EVENT_TABLE[key]:isTimedOut() == true then EVENT_TABLE[key] = nil end end end I know it's a lot to take in, but I have found this VERY USEFUL for the stuff I am working on, and I love sharing these cool solutions for the interesting problems they solve. Please let me know if you have any questions about anything pertaining to this EventItem class or lua itself, and I'll be happy to help!
  2. This is a follow-up to: However, this is brand new enough to warrant its own thread. Now if you're a fellow Software Developer / Software Engineer like myself, you will quickly come to realize that maintaining thousand line long LUA scripts for SAPP is a pain in the you-know-what. Using LUA's built in module system is also a pain in the you-know-what, as you have to ship all of the dependency files. Basically, there is no good way to create your own project file structure, and bundle the files down to a single file. Well, I'm here today to end that misery for you. Look no further than the BRAND NEW Lua Bundler for SAPP. This bundler allows you to use new statements to modularize your lua projects: -- BEGIN_IMPORT -- END_IMPORT -- BEGIN_IGNORE -- END_IGNORE import ... end To automate the creation of a single output file, and avoid issues like these: myCustomPrintFunction() function myCustomPrintFunction() print("My Custom Print Function!") end More info about what the statements mean, and how to use them here: https://github.com/Nickzster/Lua-Bundler-For-SAPP I literally just created this in a day so that I can start using it immediately, but thought others could put it to good use. It's kinda primitive, and untested, so I plan on iterating and making it better as I use it more. If you find any issues, feel free to post an issue on the Github repo. I hope this helps someone!
  3. INTRODUCTION If you have written advanced LUA scripts for SAPP, you will quickly realize that the size of the file can grow dramatically, to well over 1k+ lines. This can be very inefficient for busy bodies like myself who don't have a lot of time to work on halo projects. In my experience of LUA scripting, I have realized there are 4 main components of a LUA script that can be abstracted: API version, Global values used by LUA scripts (BIPED_ID tables for biped switching, tables that store directories for biped models, etc.) Callbacks (OnScriptLoad callback definitions & implementations) Functions (That you can call from callback implementations to make them look neater. This also includes utilizing the prototype model to implement complex classes) Cleanup for OnScriptUnload Using this utility, you can now initialize an empty project that gives you a template project to start from. This template consists of: callbacks (directory) callbacks.lua --> allows you to implement your callbacks in this single file. NOTE: You can make as many files in here as you want. You can even implement each callback in a separate file. definitions (directory) config.lua --> allows you to define basic config (API version) definitions.lua --> allows you to define callbacks in this file (OnScriptLoad) garbage_collection.lua --> allows you to define your garbage collection in this file. (OnScriptUnload) variables.lua --> allows you to define global variables in here. NOTE: You can make as many files in here as you want. functions (directory) functions.lua --> utility functions that you call from your callback functions (So that you don't clutter your callback implementations) NOTE: You can make as many files in here as you want. You can implement all of your utility functions in separate files. config.lua --> For the API version, and Global values used in LUA scripts (listed above in #1) Figure 1 - Shows the working directory in VSCode. Once you are done, you can use the utility to build all of the lua files into one working .lua file. Figure 2 - Shows the built lua file from the files in Figure 1. GETTING STARTED Simply download lua.py located here: https://github.com/Nickzster/Lua-Projects-for-Halo There are three commands for this utility: python3 lua.py init <name> Run this command to initialize a new project. It will create a new directory named the specified <name>, and create the respective files and directories listed in the Introduction section. Write your LUA script. When you are done, run this command: python3 lua.py build <name> This will take all of the LUA files located within the specified directories, and build them into one file, named <name>.lua, that you can then use for Halo. To better understand how to set up your scripts, the build process builds in the following order: Builds all of the files in definitions directory, in alphabetical order. Builds all of the files in the functions directory, in alphabetical order. Builds all of the files in the callbacks directory, in alphabetical order. Running python3 lua.py help Displays the two commands in the terminal for reference. Admittedly, it has been a while since I have messed with SAPP LUA scripting. Before getting back into it, I wanted to build a utility for myself to make this workflow more efficient. If there is anything that I missed, forgot, or made a mistake on, please let me know! I hope this is helpful for some of you! *Made some major edits to the original workup, as I thought this was a better layout.
  4. If I were to develop my own multiplayer map with AI, could I use hsc to spawn AI? (for instance, me and a group of people walk through a trigger volume to spawn the AI) Or do all of the AI need to be spawned in on match start in order for this to work properly? Great work on this stuff!
  5. I built it for me personally. I've learned that being able to highlight and differentiate functions from types helps me speed up my productivity, and allows me to cut wasted time reading scripts in notepad. Being able to save time developing maps in my busy day-to-day life is a win for me. I decided to release the extension because I felt it would be selfish to withhold this tool as it might be useful to someone else. Plus, since it is open sourced, someone who is better than me at Regular Expressions, Context Sensitive and Context free grammars can make a contribution to make it better.
  6. Title and image describes it all. Installation instructions can be found at: https://github.com/Nickzster/hsc For those who like old school Halo LISP scripting. Thanks DSali for pointing out the errors in my original image. Fixed the image to fix the errors.
  7. The purpose of the website is, when a noob asks "What is Halo Custom Edition?", www.haloce.org will serve all of their needs. I would also like to make it a one-stop-shop for resources for the community. DSali, I like how you mention that each website can be ran with its own "tastes" and "spice", and I absolutely agree. However, how do you find these different communities? Where do you start? I want this website to be able to bring these new players to these communities. As soon as I posted this thread, I was invited to several discords that I didn't even know existed. Wouldn't it be nice to have everything in one place? I appreciate the comments everyone, please let me know what you think. Also, for those web developers / programmers out there, the website is open source, so if you wanna contribute: https://github.com/Nickzster/haloce
  8. Hey everyone! I was thinking of a way to contribute to this community, as I feel that Sector 09 wasn’t enough. I have a bunch of projects (as you might have read on my release thread a while back) that requires too much work for me to complete in this day and age. So I got thinking, and I realized my contribution was under my nose this entire time… I am currently majoring in Computer Science (I graduate in December, woo hoo!), so a big thought on my mind is landing a job when I graduate. I am a firm believer that the web browser and mobile applications is going to be a big part of the future. Now isn’t a better time to get into Web Development, and learn serious skills like designing websites and building full stack web applications. I have been learning HTML / CSS / Javascript, Front End frameworks like React & Redux, Node JS on the Backend, and other backend frameworks like Express. The answer to my contribution is in the form of a website / web applications, of course! Now let me ask you a question… When someone asks you “What is Halo Custom Edition?” or, you try your best to explain what Halo Custom Edition is to your friends… how do you explain it? After pondering these questions, I came to the realization that this community has two problems: 1. It is very fragmented (Some users actively participate in Discord Servers, some users actively participate on Halomaps, and some users actively participate on OpenCarnage, some users actively participate on Youtube, and the list goes on) 2. With the tremendous amounts of projects, it can be very difficult to explain what Halo Custom Edition is, what Halo Custom Edition is capable of, and what you can actually do with it. Now I get to the point of this post, and my solution to this problem: www.haloce.org I have built a simple landing page that is designed to “describe” what Halo CE is, how to install it for those folks who are new to the community, and to have a central HUB for the entire community. If you follow the link above, you will see this landing page in full (note, that it is not responsive yet. I will make a pass to make it mobile friendly). You’ll probably also notice a lot of Gibberish on the pages (This is Latin text placeholder, called Lorem Ipsum) and you’ll also notice ugly empty images (that display 1900x1080 rather than a pretty image). This is why I am writing this post today. Have you ever gone through the same spiel that I have, not having any ideas to contribute to the community? Or not having the technical experience to make a map? For those who want to contribute something to the community, I ask for you to help me replace the Lorem Ipsum text with actual content that clearly describes Halo Custom Edition. I also ask for you to help me create or find images to replace the ugly 1900x1080 images. I also want to reach out to the mappers / modders of this community, and direct you to this page: www.haloce.org/sector09/sector09.html Now, I am not trying to toot my own horn with Sector 09, but I am very intimate with the project (I made it, for those who are unaware), so it was easier for me to build a sample “Project” page. I wanted to come up with a proof-of-concept “Project” page, and build project pages for those in the community that are deserving of one. So I ask of you, the modders / mappers to take a look at the Sector 09 page, critique it, and think of other content that a “Project” page might need. I thank you for taking the time to read this post, and to contribute to this website for the fellow community! -Nickster5000
  9. I have received a request for source for Sector 09, so I figured I'd publicly release it (I know, its been long overdue.) Sector09 RAW Release - ALL BSP's - Nickster5000 NOTE: Files preceded in _ means that they are important. I marked them with this underscore as I was going through the files. Description: Included in this release is ALL of the iterations that sector09 went through from 2012, all the way to its release in 2016. Included in this release is the following directories, and notes about what this directory consists of: ***bitmaps -RPG_Rips and RPG_Rips2 should contain all of the bitmaps that I ripped from halo 3 ODST. NOTE: SOME OF THE FILES WILL HAVE BROKEN REFERENCES. I DID NOT RENAME ANY OF THE FILES, but they may be in different locations. I recommend that you rip your own version of the Halo 3: ODST bitmaps using adjutant to suit your needs. ***misc -Contains files that were used in showing sector09, and other documentation used in its development. ***sector09-2012 -The very first iteration of sector09. I could not find the original... however, I found two animation demos that I created on the original model, which should suffice. ***sector09-2014 -Old sector 09 build. I believe one of these didn't even make it ingame. Don't remember a whole lot about these files, so have fun playing around with them! ***sector09-2014-b -Another old sector 09 build. More files that I made for sector 09. Don't remember a whole lot about this one either, so have fun playing around!!! ***sector09-ce3-2015 -Second to most significant file in this pack. This was the demo that was showcased at CE3 2015. ***sector09-2016 -Most significant file for sector09's release. Contains the version of the BSP that was in the final release, as well as some updates to it. xtra -Extra files that I found laying around. README.txt - this file. Download Here! Please let me know if there is anything missing. Enjoy! -Nickster5000
  10. Hello Halo CE Community, I know you were probably expecting a really cool "GTA" mod for Halo CE, and we want to deliver on that. However, we have recently done a couple of thorough play tests and decided that the mod is not ready to be released as quickly as anticipated. We want to take some time and really polish the mod, and perhaps remake some aspects of the mod. I deeply apologize for showing this off before it was ready. I feel terrible revealing all of these details, and then not delivering them as soon as we are anticipating. To make up for this, we are going to deliver a high quality GTA Halo mod in the future that is extremely fun to play. Most of the features we announced will still be there. Thank you for your understanding, and I hope you guys are looking forward to what we are making. Happy New Year! -Nickster5000
  11. I agree. I try to stay away from doing too much memory access outside of the SAPP functions, but that implementation is much more concise. I changed it to your implementation if that's okay with you.
  12. I figured since I couldn't find a command to do this in SAPP's documentation, and I needed it heavily in the mod I am working on, I thought it'd be a nice utility function to release: function getDistance(Player1, Player2) --returns the distance between two players Player1X = get_var(Player1, "$x") Player1Y = get_var(Player1, "$y") Player1Z = get_var(Player1, "$z") Player2X = get_var(Player2, "$x") Player2Y = get_var(Player2, "$y") Player2Z = get_var(Player2, "$z") local diffX = Player1X - Player2X --x1-x2 diffX = diffX * diffX--((x1-x2)^2) local diffY = Player1Y - Player2Y diffY = diffY * diffY local diffZ = Player1Z - Player2Z diffZ = diffZ * diffZ local sum = diffX + diffY + diffZ return math.sqrt(sum) end
  13. -snip- I'm dumb and didn't read the tutorial thoroughly enough.
  14. Because I put the tags together quickly. I wanted to focus my effort on the team-switch aspect.
  15. Very simple project that I made today. Red team plays as spartans, blue team plays as elites. All the files are included. Chimera has been tested with the version in the .zip, 560, and 572(unstable release). Download The source is also on my github Wanna make your own team bipeds? bSwitch.lua, scroll until you find: BIPEDS = { [0] = "bourrin\\halo reach\\spartan\\male\\mp masterchief", [1] = "cmt\\characters\\elite_v2\\player\\elite_v2_mp", } Simply change the directories to the models. [0] = red team, [1] = blue team. Make sure to reference both of your team's bipeds in guerilla's reference section. hvc.lua (you will obviously need to rename this .lua file to your map name), scroll until you find: --redTeamHands = "halo reach\\objects\\characters\\spartans\\fp\\fp" --DEFAULTED to currently set hands in globals. blueTeamHands = "cmt\\characters\\elite_v2\\fp\\minor" --Set the hands you want for blue team here. Change the blue team hands to the directory of where your blue team hands are located. The script will automatically pull the tag from the red team's hands. You also need to reference these fp hands in the guerilla reference section. Credits: Kavawuvi / 002 - Biped switch script, making such an amazing client-side app. aLTis - bigass_mod.lua fp hands changing. Nickster5000 - Putting it together, setting it up for red team and blue team Anyone else I forgot to mention.