Pizza Tower-Styled Afterimages

[Open Assets] Pizza Tower-Styled Afterimages v2

I've been a bit busy recently, working on quite a few mods, but I'd thought I'd come back here and make this addon completely reusable. You can now use the afterimaging spawning code AND the afterimages' thinker! If the code says otherwise, just ignore it!

Anyways have fun lol
goofy cat.jpg
Hey all! I've come up with a new Afterimages system! Now, the afterimages look much closer to Pizza Tower's. I've also made all the commands start with ptai_ to make them easier to type. Other than that there shouldn't be any bugs, but if there are, please make sure to tell me!
srb20265.gif
Update

-Fixes activation method being set to nil when loading the mod the first time
Update time!
This should fix Custom Skins not being synched to people who have rejoined.

Changelogs:
-Custom Skins should be synched with everyone, even when they leave and rejoin
-ptafterimagesaddskin can now edit existing characters
-ptafterimagesaddskin can no longer add afterimages to Soap
-ptafterimagesaddskin's admin check now works properly
-Added a command (ptafterimageslistskins) that lists all skins that can emit afterimages
-Updated ptafterimageshelp to add new commands
New build time!

What's new in this build?
  • Added a command ptafterimagesaddskin
    • This adds skins to the Afterimages system, allowing them to emit afterimages, just like other chars!
    • How to use: Put the skin's name (the name you see when you put "skin" in the console) as the first argument, and a boolean as the second argument if it has custom dashmode
I hope you have fun with this new update!
Note: If you want global afterimages, go download v1.3!

Updates:
  • Improved custom character thing. Now more similar to CC_Tricks or solchars.
  • Lua:
    //candidate system
    
    if not PizzaTowerAICandidates
        rawset(_G, "PizzaTowerAICandidates", {})
    end
    
    /*
        Add candidate for Afterimages.
        Stuff to put:
        -isspecial : Sets PTAI Specical char for that skin. Best for characters with custom dashmodes
        -cmdcustom : Allows the player's custom colors
        -skincustom : Replaces vanilla styles & colors to use the ones youve set
        -sc1 : (if skincustom) First afterimages's color. For use with skincustom.
        -sc2 : (if skincustom) Second afterimages's color. For use with skincustom.
    
        PizzaTowerAICandidates["exampleskin"] = {false, true, false}
    
    */

Should work now, as this new update comes prepackaged with vanilla chars, RushChars, Surge, and Adventure Sonic.
Yeah that's right! We're goin' back in time to the first Thanksgiving to get Turkeys off the menu! I added better support for custom skins, so now you don't have to copy all the files now. (hopefully)

Here's how you can add Pizza Tower Afterimages to your skin!
Lua:
if not PizzaTowerAfterImagesCode
    rawset(_G, "PizzaTowerAfterImagesCode", {})
end

--[[
Copy the above into your script!

Add a PizzaTowerAfterImagesCode function somewhere in your script to spawn the afterimages.
In the function spot, you'll want to insert these:
    - p: The player_t. You can insert player, p, or whatever you have for it.
    - me: Player mobj. You can insert player.mo, or whatever you have for it.
    - skin: Your skin. You'll need skins[player.mo.skin] since PizzaTowerAfterImagesCode uses skin_t variables.
    - overwrite: (bool) Makes the afterimages override the normal activation methods.
    - cmdcustom: (bool) If p.ptaistyle == 3. Using a variable for this would work best...maybe...
    - skincustom: (bool) Overrides styles and uses whatever colors you set for this.
    - sc1: (SKINCOLOR_*) The first afterimage's color. Use if you set skincustom to true.
    - sc2: (SKINCOLOR_*) The second afterimage's color. Use if you set skincustom to true.

If you need SKINCOLOR_ constants, check out the wiki page! https://wiki.srb2.org/wiki/List_of_skin_colors
Please note that afterimages will only work if this addon or another PT Afterimages-using mod are loaded!
If you want the afterimages to work regardless, paste an *UNEDITED* copy of LUA_FUNC into your character!

I didn't test this, so I know there's bugs to be found.
If there's any bugs please let me know!
Yeah that's right! Customizable colors! For the afterimages!

What's new in this build?
-Added two commands to change the afterimages' colors
ptafterimagescolor1 - Changes the color of the first afterimage
ptafterimagescolor2 - Changes the color of the second afterimage
-Modified 2 commands
ptafterimageshelp - Shows the two commands from above
ptafterimagesstyle - New style added for the custom colors

I hope you guys have fun with this version!
Gif was too big so Imgur link
Didn't tweak the afterimages themselves, but rather when they appear.

What's new in this build?
-You can no longer emit afterimages while dead.
Forgot older Soaps don't emit afterimages themselves, so I fixed that.

What's new in this build?
-Any Soap before indev3.0.p3 can now emit afterimages.
Back
Top