#Custom Enemies Support/Thread

1 messages · Page 3 of 1

cunning wind
#

Yeah, turrets attached to vanilla green uns fire immediately.

#

Which is why I did this.

pearl ether
crimson linden
#

Didn't know those Green (g)uns were official

#

I thought they were a fanmade thing

frail matrix
#

i think that's totally balance mod fish

what that means was like
if you attach a turret to a vanilla green un

crimson linden
#

Oooh I understood now, my bad lol

cunning wind
#

@safe rover, what are the args in Lua that can be applied to a summoned vanilla homingMissile entity to make it not home toward the player in a brief period of time?

safe rover
#

Don't recall there being any

#

homingDelay is a command argument you can use

#

Time in ticks

cunning wind
#

Doesn't seem to work.
-# The bottom enemy is the Lua one.

safe rover
#

30 ticks is the default value, so that makes sense

frail matrix
#

sometimes when i think it doesn't work, i just crank the number to the absurd to see if it affects anything fish

cunning wind
#

Set the homingDelay to 600 ticks, and nothing happened either.

safe rover
#

It's also an integer, not sure that matters though

cunning wind
safe rover
#

Guess it does matter

cunning wind
#

NGL, those missiles traveling straight seems funny. fish

#

What is the default speed of the missile BTW?

safe rover
#

You can set currentAngle integer in degrees as well

cunning wind
#

Thank you Kroporo!
I have now perfectly replicated the Lua missile gunship's launch behavior.

cunning wind
#

Apparently, depending on the move speed of the Lua missile ship, its launch X positions seem out of sync with the vanilla one.

#

However, I was somehow able to get them right as the ship is at its slow speed.

frail matrix
#

it might be missile pos

cunning wind
#

Currently making a workaround here.

frail matrix
#

are you using world position or position for your missile pos?

cunning wind
#

Currently, they use world position.

frail matrix
#

i see

cunning wind
frail matrix
#

it kinda does fish
i recomend keep using world position for shooting

cunning wind
#

I guess world position is probably more consistent.

frail matrix
#

position kinda depends on the on screen coordinates (the screen moves so yeah)

while world position is kinda of a true position

cunning wind
#

Welp, good to know.

#

Tho I'll need to prepare one last exam for tomorrow.

frail matrix
#

good luck ^^

cunning wind
dim horizon
#

This would be good for Missile Cars.

#

in A Totally Rebalanced Mod.

cunning wind
frail matrix
#

1 tick too early for the spawn

#

Once i finish my update, i may get back into creating more stuff

cunning wind
frail matrix
#

Funny, never noticed turrets need 1 tick to start it behaviour

cunning wind
#

LMAO

#

IG it doesn't matter in the grand scheme of things.

#

Except for eagle-eyed players.

frail matrix
#

You almost never see a turret spawn anyways

cunning wind
#

Yeah, true. :p

frail matrix
#

Now is just fixing the position of the turrets

And the on hit knockback

cunning wind
#

BTW, curious regarding the application of OnDeinitialise.

frail matrix
cunning wind
#

Gotcha

#

Perfectly aligned. :D

frail matrix
#

I wonder

#

If you get the knockback

Remenber the legacy thing?
For flip planes

Maybe can be used for platypus +

cunning wind
#

Gotcha

#

OnHitByBullet() it is.
-# Meanwhile, enjoy watching the flip plane shedding unholy amounts of debris. >:3

frail matrix
#

Ah yes

The extra "gore" add on

cunning wind
#

fish_dinner Ho boy, Lua modding is even more addictive than practicing Nasty runs. I'mma need some rest. ZZ

frail matrix
#

Good night

cunning wind
#

I assume you'll be spending the rest of your day finalizing the release candidate of Casinopolis D3.5.

frail matrix
crimson linden
# cunning wind

Screw you! (Jk)
I wanted to finish this one first but you beat me to it 😂

#

Honestly yours looks quite awesome tho
Mine was a bit off, specially on the deacceleration part

#

No idea how you pulled that off so nicely 🤔

cunning wind
cunning wind
#

The end result is actually kinda a mess, but totally functional. :3

crimson linden
#

true!
kudos to you for achieving it tho! It was a very hardcoded enemy, so I've been wanting to have a lua version of it for a while hehe

cunning wind
cunning wind
cunning wind
pearl ether
#

flipplane moment

cunning wind
#

@safe rover, how to apply bulletSpawnDistance argument for any Lua fire pattern?
Or rather, what are the applications for the that field in particular?

#

So far, I already know how to use the rest as of late.

safe rover
#

I believe TurretData was read only data you got out of BehaviourData

cunning wind
#

IK.

#

I just need an example of bulletSpawnDistance used on a sample Lua fire pattern.

safe rover
#

It's not something for fire patterns, the fire patterns are just for timings

#

The spawn distance for most objects is just an addition to the radius when we spawn want to spawn a bullet

cunning wind
#

So we have to set up a radius variable then?

safe rover
#

Completely depends on how you want to set up your entity

cunning wind
#

Gotcha

#

Tho a small example of its use case wouldn't hurt NGL. :3

safe rover
#

When bulletSpawnDistance is 0, most bullets in the game will spawn at Vector2(bulletOriginOffX, bulletOriginOffY) + GlobalPosition

#

More examples is planned, I'm just stationed with another project right now

cunning wind
#

Fair enough.

cunning wind
#

Alright, I managed to apply the spawn distance variable.
Thank you @safe rover! clay_heart

pearl ether
#

peak

cunning wind
#

By this point, I have pretty much made a softcoded rendition of the cannon gun.

pearl ether
#

it has more distance

cunning wind
pearl ether
#

both missile and normal

#

I use it for the cannonredfins

cunning wind
pearl ether
#

real

#

here's a huge challenge

#

make an accurate squidmother

#

luasquidmother

#

I mean you can make that Slot train from casinopolis making luasquidmother might be a challenging one

#

it has hidden turret

#

explode turned into a boss 5

#

spawn squids

#

that means need luasquid (optional)

#

shoot missiles

cunning wind
# cunning wind

@safe rover, is there a way to specify a range for the spritesheet to be used for damage frames?
This will be useful for the Flip Plane replica I have been working on.

cunning wind
safe rover
#

Not really the range, though you can change the maximum number with an optional parameter

#

Isn't too hard writing your own utility function for it though

cunning wind
#

A bit rough, but gets the job done.

#

Now the damage framing system is the only thing to implement.

frail matrix
#

shouldn't be that hard to make a custom damagesprite function

#

you basically divide in the ammount of frames and well hp and the other and uthm and then the clay_spiral

cunning wind
#

5 frames / maxHitPoints?

frail matrix
#

you can get the max ammount of frames in a spritesheet
Then subtract from the ammount taken by the animation

then is just molding it with the hp

#

ok so what if you get the total let say 5, then divide by the hp
you get the threeshold
so is just if the hp goes trought that threeshold, add + 1 to the sprite var,
then reset the hp counter
so it can mold to any spritesheet number

cunning wind
frail matrix
#

was thinking just a counter, that just counts when the hp taken goes above the threeshold

cunning wind
#

I'm unfortunately too sleepy to continue. ZZ
sry

frail matrix
#

it's okay

frail matrix
#

if timer > 82 then mx = mx - 0.065 end if mx < -1.3 then mx = -1.3 end

#

quite more compact fish

i think it might be off my some ticks but idk

cunning wind
#

Might as well test it stacked directly top of each other, which is what I like to do when making accurate movements.

frail matrix
#

gotta give them a unique texture, 1 second

cunning wind
#

To make things easier, set the lua flip plane's sort order to 400 or smth, then temporarily whitewash its sprite completely.

frail matrix
cunning wind
#

Ah, I see what you did with the Lua Flip Plane's sprite:
Replace it with your take on the bomber sprite. :3

frail matrix
#

is what i had in hand
too lazy to open the program fish_dinner

cunning wind
#

Perhaps the same could be done to the staggered flip animation.

frail matrix
#

gotta give it a try

atleast is less if mazes fish_dinner

#

also i have the pre makyuni damage frame code

#

also, do you know what fruit set flip planes uses?
i might need that info for something

cunning wind
#

Let me check then.

frail matrix
#

i think is a cherry, 2 bananas and a grape

cunning wind
#

Might as well check out level_defaults.json.

frail matrix
#

ah is 5

#

it works

you can just do
self.fruitSet = 5

cunning wind
#

I doubt there is currently an efficient way to to set up a default fruit set on a Lua behaviour, unless I am missing something out.

#

Oh, NVM.

cunning wind
frail matrix
#

so i basically saw it like yesterday

i think we need to do more types lua reading

#

but yeah this is all you need

cunning wind
#

Found it.

frail matrix
#

so i guess is time to work on the animation if maze

then we have like a really nice recreation

i do say 99%

cunning wind
#

Funny that you did say that in particular back then. :P

frail matrix
frail matrix
cunning wind
#

The initial speed is supposed to be 6.5 right?

frail matrix
#

is set to 6.5 but seems that it trails

#

or maybe is the sprite i dunno

#

as is spawn correctly

#

that means the starting velocity is lower than the vanilla one

cunning wind
#

Hold on...

#

I'm testing your changes right now.

#

You have a problem with your sprite. :p

frail matrix
#

how so

cunning wind
cunning wind
# frail matrix how so

By the time you edited the sprite, I think you might have accidentally offset its position.

frail matrix
# frail matrix not the sprite

i mean in this example im using the same sprite

and same result

i think some of the changes might have change something in the animation code

cunning wind
frail matrix
#

i'm so confused

cunning wind
#

I very much feel you.

frail matrix
cunning wind
#

I used your changes.

frail matrix
#

try using the regular flip plane sprite

cunning wind
#

My game is slow for some goddamn reason.

#

Wait, lemme restart my PC. -_-

#

Not even off in the slightest.

frail matrix
#

my game is cursed

cunning wind
# cunning wind

So as I said earlier, I tested your change, and a simple deacceleration isn't even accurate apparently.

frail matrix
#

i think it might
you just need more force

cunning wind
#

Either way, thank you for showing me how default fruit set works in Lua. :3

frail matrix
#

genuine puzzled why the offset

cunning wind
#

No clue either.

frail matrix
# cunning wind

also maybe try something like 0.07
since seems that the force is weak

cunning wind
frail matrix
#

too much force, then is an inbetween
like 0.068 or

cunning wind
#

Alright, even with an inbetween, it still is off.

frail matrix
#

weird

cunning wind
# cunning wind

This perfectly demonstrates it, as it actually is in-between.

#

As you can see, it goes perfectly into the same spot once at max backward velocity.

frail matrix
cunning wind
#

Therefore, I'll be settling with a minimum of 2 deacceleration values.

frail matrix
#

if only i were able to test it with not offset

maybe i could pull the cubic easing

cunning wind
#

I think I solved the accurate deacceleration with only one value.

#
    if timer >= 82 then
        mx = mx - 0.065
    end
frail matrix
#

what did it change

cunning wind
frail matrix
#

ah, that was an easy change

cunning wind
#

IKR?

frail matrix
#

🥳 🎉

cunning wind
#

And I love how its deacceleration speed shares the same value as knockback movement decay.

#

knockback = knockback - 0.065

frail matrix
#

now the only to thing to overhaul would be the animation thing

#

my aim is really, small code fish

cunning wind
#

And not a chonky one like the one you used on your green big un in essentials.lua.

frail matrix
#

that was really just experimental with no cleaning fish

#

bosses have like a ton of code too, but i think they are more readable

cunning wind
#

Oh, I also managed to simplify the flip animation index.

#
    if flipSprite == 1 or flipSprite == 3 or flipSprite == 5 or flipSprite == 7 then
        flipSprite = flipSprite + 1
        flipTimer = 2
    elseif flipTimer <= 0 and flipSprite < 11 then
        flipSprite = flipSprite + 1
    end
#

Oh, and I also made it so self.fruitSet can be overriden by "fruit_set" level command arg.

#

Otherwise, it will still by default use "fruit_set": 5.

#

Yeah, all these things are applied to my work on the Lua Flip Plane.

#

By this point, people would have more control over the entity drops and no longer have to deal with hard-coded drops that are irremovable.

cunning wind
crimson linden
#

Peak

frail matrix
cunning wind
#

Notable changes since the last time MAKYUNI updated the file include the following:

  • It now has a default fruit drop that can completely be overriden by fruit_set level command argument when applied.
  • Its turrets can be configured through topTurret and bottomTurret level command arguments respectively.
  • Simplified deacceleration velocity.
  • Simplified animation index.
cunning wind
#

The top Flip Plane has its fruit_set level command arg set to the value of 9, i.e. it only drops a coin balloon crate.
The bottom one doesn't have the fruit_set level command arg, therefore its value is set to 5 by default.

pearl ether
#

I think you can add more fruitsets via level_default

cunning wind
#

Provided that the fruit sets have already been set up in a level defaults data.

pearl ether
#

Like gunship

cunning wind
pearl ether
#

Deflector

frail matrix
# cunning wind

i remenber you said, you concepted this enemy way before, i wonder what other crazy ideas you did
-# and if they are possible of course

cunning wind
#

I pitched a concept of a bomber variant that would drop a nuclear bomb that screenwipes the player when it touches the ground.

frail matrix
#

well tecnically you have that already fish

just move the bomb timer screenwipe into a mine, and put it onto the bomber flip plane code

cunning wind
#

Ye, I knew it'd be that simple.

#

:3

cunning wind
crimson linden
#

You should rename to goate-

#

Oh wait you already did fish

pearl ether
#

I had an enemy idea

#

but I am not sure if this would work

#

but lemme transfer my LUA learnings

pearl ether
#

oh well I tried

#

OH WELL!!

final osprey
# cunning wind

Just saw this. Peak Heavy Weapon reference. This is awesome, possibility for implementation in Platypus 2 Reclayed? 👀
Either as a new enemy, or higher difficulties exclusive feature.

cunning wind
#

Could be an original Platypus 2 Reclayed enemy.

#

And will appear more on higher difficulties for sure.

final osprey
#

Sounds great! 🙌

#

Basing some enemies off of Heavy Weapon is quite interesting, a lot of it could work and fit the Platypus engine.

#

I personally love the Blimp that drops a ton of bombs and when destroyed drops bullets, and the Big Ship that drops a nuclear mine wiping the enemy entirely with no chance, hehe.

cunning wind
#

Would genuinely love to create some enemies inspired by them for Platypus 2 Reclayed.

frail matrix
#

would be a great addition to have sprite rotations

specially for bullets
as lightning stars use sprite rotations for lightning

also for smaller sprite sizes

crimson linden
#

Imagine having a spritesheet for rotating lightning 💀

frail matrix
crimson linden
#

I assume rn you'd end up with an 80.000 x 80.000 resolution image or sth like that
So yeah I totally understand and agree with your suggestion

cunning wind
crimson linden
#

Dang it...

#

I would assume you have to divide humongous entities into different sprites/images then

frail matrix
#

well, gate uns exist
-# somehow

#

alternatively you can do the sky serpent method

cunning wind
# cunning wind

Well, TBF the sprite had to cover the entire screen, but before I got it to work, the entire spritesheet was too large.

#

And AFAIK, it uses 16 frames in total.

cunning wind
frail matrix
#

not sure if you want anything bigger than that for a singular entity

crimson linden
safe rover
#

Rotation comes with quite a few caveats, so that's why mostly nothing uses it, despite the setup technically supporting it

cunning wind
#

I assume lightning rotation is totally hardcoded then.

cunning wind
safe rover
#

Not sure that's planned, but might be worth exposing with a big warning connected to it

cunning wind
#

I see.

frail matrix
#

is a worth tradeoff

cunning wind
#

Heya, although we are able to get the scrolling speed of the background via Globals.ScrollingSpeed(), apparently, there isn't a way to get background scroll speed multiplier, or at the very least, it isn't taken into account.

cunning wind
#

@safe rover, will there ever be something like Globals.backgroundSpeedMultiplier?
Basically, it gets the value from the level command setBackgroundSpeedMultiplier.

#

Also, I wonder if it will be possible in the future to have an entity playsound in a similar manner to lightning sfx, wherein the sound loops over and over until a specified duration in ticks has reached or it deactivates prematurely through entity deactivation or kill.

frail matrix
#

is there a way to kill children entities?

crimson linden
#

Tary exposed

frail matrix
#

not better than this fish_dinner

frail matrix
#

anyways, is there a way to render something above the player?

crimson linden
frail matrix
#

yeah sort order, however it seems that the player might just bypass the sort order

crimson linden
#

oh well that kinda sucks :(
it shouldn't do that, imo

frail matrix
#

nah, that is like a common thing in games

crimson linden
#

fair nuff lol
but yeah, there should defo be an option to make sprites bypass it too.
will need it for my mod aswell

frail matrix
#

maybe there a certain sortorder number

but if you input something too big then it just goes back to a very small sort order fish

crimson linden
#

dang
well with sortnumbers and such I thought you could even spawn things on top of the HUD, but now I'm starting to think that's unlikely

frail matrix
#

you gotta play with the limitations.

cunning wind
cunning wind
cunning wind
#

Imagine if AdamCom-, I mean AdamChaos makes a meme about that.

cunning wind
#

Where Tartaz was suspected on planning to kill ch-.

cunning wind
#

Oh BTW, before we close this random ass discussion, I'd like to remind you that if ever "Tary exposed" meme spreads to the rest of the server, you are one to talk @crimson linden, haha. :3

safe rover
cunning wind
#

I'm already having loads of fun toying with new Lua tools. anthony_kiwi

#

Two different enemies sharing the same Lua script thanks to getting their customBehaviourData.

cunning wind
#

Holy shit, I think I'm addicted to modding. BoomSpin

cunning wind
#

WTF am I doing. clay_grimacing

#

-# Seriously, I legitimately love those new Lua functions!

frail matrix
#

WHAT ITs OUT??

safe rover
#

Hehe, the weird visuals are likely due to the reflections being enabled on that sprite (the shader doesn't support rotations)

cunning wind
#

Interesting.

cunning wind
frail matrix
#

I guess i gotta delay stuff till is onto the public

cunning wind
#

Your work on Casinopolis?

final osprey
#

Wait, is that an actual enemyZap rotating?

cunning wind
#

Nah, it's a custom Lua entity that demonstrates rotatable sprites.

final osprey
#

Ah, fair enough.

cunning wind
#

Super useful for rotating laser entities.

frail matrix
cunning wind
#

Fair point.

#

So far, I've only scratched much of the surface in the newly buffed Lua modding api.

#

And it doesn't help that I am about to prepare for a weekend-long vacation.

safe rover
#

It shouldn't stay in beta like this for long, just making sure that everything is in order and perhaps catch potential oversights

cunning wind
#

Well said Kroporo. L6badge

#

Also, thank you for adding much of the features I had requested, ranging from splitted sound definitions to more new level commands.

safe rover
#

🫡

cunning wind
#

And let's not forget the Lua expansions being made. anthony_kiwi

safe rover
#

That one goes to @buoyant lake, I'm just the gun for hire

cunning wind
#

Well then, I hereby extend my gratitude towards him as well, even if he is probably on leave for a few days like he alluded to earlier.

frail matrix
#

i wonder if the being able to manually set the position of an entity is in the beta

safe rover
#

Yes

frail matrix
#

i tried but seems that didn't let me

frail matrix
#

self.worldPosition = { x = self.worldPosition.x + mx, y = self.worldPosition.y + my }
basically tried setting them via it, but only got a couldn't assign,

maybe is done with other function?

frail matrix
#

@safe rover wondering this ^

safe rover
#

Odd, that looks alright to me

frail matrix
safe rover
#

Right, it's lastPosition and nextPosition that are available to be modified on BaseEntity, as the game never modifies Position and WorldPosition either

#

Update is queued that will expose the setters too

cunning wind
#

I wonder if said setters will be part of the upcoming update.

safe rover
#

I just said so, yes

#

Should be up in about 1.5 to 2 hours

cunning wind
#

We'll be thanking you then.

frail matrix
safe rover
#

Should be, yes

#

Either: 0b99d972d or 002c13717 should currently be up, both have it

frail matrix
#

seems that my beta won't update fish_dinner

#

still stuck at the march 5 version

safe rover
#

I'll take a look

cunning wind
#

I have no clue tho.

safe rover
#

Didn't realize that we create a new non-automized branch, your change should be in any moment now, the player coordinate change from today needs a bit longer in the oven

cunning wind
#

Ah, the one Bonnie suggested?

safe rover
#

Yes

cunning wind
#

We can wait. clay_smile

frail matrix
#

finally updating ^^

frail matrix
#

the sprite is not following the entity when using position setters

cunning wind
#

Fly rework huh?

frail matrix
#

that's the idea

cunning wind
#

How did you set up the position setters, even if bugged atm?

frail matrix
cunning wind
#

I tried using position setters for use in default entity spawn positions, and nothing worked.

#

Besides, like you alluded to, it's probably bugged still.

frail matrix
#

what i ponder, is that this may tied to any core thing on the game clay_grimacing

cunning wind
frail matrix
cunning wind
#

I wonder if you have shared your original idea before.

cunning wind
#

LMAO, bootleg Nitro emojis be like...

safe rover
#

I'll just copy paste the entry for these setters directly:

Warnings

The game uses interpolated positions to support higher framerates without too much additional load.
Due to popular demand, BaseEntity.position and Player.position are now technically able to be set, but setting it carelessly will result in undefined behaviour and laggy movement on refresh rates above 60hz. For that reason it is recommended to stick with BaseEntity.movement (and not move the player at all)

If you really need to set positions: BaseEntity.lastPosition and BaseEntity.nextPosition are used internally in conjunction with BaseEntity.lastUpdateTime and BaseEntity.nextUpdateTime to determine the final position of the entities (and the player), the game handles this for you when using BaseEntity.movement. By using position setters, you opt in to being on your own

#

Basically, you will need to set lastPosition and nextPosition as well

frail matrix
cunning wind
#
    self.lastPosition = { x = 300, y = -300, z = 0 }
    self.nextPosition = { x = 300, y = -300, z = 0 }

Edit:
-# There's no point on adding z value. :p

    self.lastPosition = { x = 300, y = -300 }
    self.nextPosition = { x = 300, y = -300 }
#

Without the mildly annoying position change frame.

frail matrix
cunning wind
#

Ye

#

Was pretty lazy at the time, as I just copied the vector from BaseEntity.movement, LOL

frail matrix
#

@safe rover

for some reason after using
self.defaultOnHitByBulletBehaviour = false
self.defaultOnHitByPlayerBehaviour = false
on a bullet, like the example

the rest of lua entities start having the same thing? like they start ignoring my bullets for no reason

#

i guess i gotta put true on every entity now if i use the bullet if i had to guess?

#

well that fixed it, but is still weird that the next lua entity copy those from the previous ones

safe rover
#

Oh god, good catch.. that too is state stored on all LuaBehaviours

#

I'll check tomorrow!

cunning wind
#

By default, when not defined, both the hit behaviours should be set to true.

#

Yeah, I first found it out over 6 hours ago. :p

#

It's what happens after a Lua entity with false hit behaviors loads.

safe rover
#

Indeed

cunning wind
#

How to actually spawn the car.lua entity properly?

#

So I tried using the velocity-based animation system used by car.lua onto a custom enemy, and this is what happened:

#

This is its current syntax:

    walkSpeed = walkSpeed + math.max(1, Round((2.7 - mx) / 3))
    walkSpeed = walkSpeed % 100
    self.animator.GoTo(walkSpeed / 5)
cunning wind
#

Also, I tried using the exact same wheel animation index from car.lua to a custom car enemy, and it doesn't work as it should be.

crimson linden
#

The wheel animation should stop when the parent entity stops, right?

#

I mean, it makes sense. Should be like that

crimson linden
cunning wind
#

I'm out of reach from my pc rn tho.

crimson linden
#

Sadly same :'>

#

Otherwise I'd be glad to help

cunning wind
# cunning wind

This was made before the beta, but feel free to add in the said features to experiment with.

cunning wind
#

So after trying out the attached sprite animator collision using the code from car.lua, it doesn't seem to work at all.

safe rover
#

That's a pretty complex shape, you may need to specify a separate collision sprite

#

You also need to call CheckCollisions with it, or it won't do anything

cunning wind
#

Gotcha

#

Apparently I'm an idiot overlooking the fact that they existed in car.lua until now.

#

It now works!
Thanks Kroporo. ^^

safe rover
#

You optionally can define custom behaviour when something does collide, think one of the other examples makes use of it

cunning wind
#

enemy_bullet.lua I reckon?

#

I'm currently out of reach with my pc rn.

cunning wind
jovial echo
#

I'm trying to customise an enemy with a squid behaviour.
However it's not as focused on the set coordinates as I'd like to.
(the focus coordinates are set with the spawn command)
How do I make the enemy stay closer to the focus points?

cunning wind
cunning wind
cunning wind
#

@safe rover, apparently, even before the Lua entities spawns, they seem to already be at max speed variable, even when they are supposed to have their vars set to 0 before spawning. This bug seems to occur in the latest beta build, and from the looks of it, the following lines of codes seem to run even before they spawn, unless of course the if self.lifetime > 0 condition has been set up, which is not the case in the transcript below:

    if leaveTimer > 0 then
        leaveTimer = leaveTimer - 1
        mx = mx + ( dx * 0.15 )

        if timer <= 0 then
            if spriteInvert == false then sprite = sprite + 1 else sprite = sprite - 1 end
            if dx > 0 then
                if sprite <= 0 then spriteInvert = false elseif sprite >= 5 then spriteInvert = true end
            else
                if sprite >= 18 then spriteInvert = true elseif sprite <= 13 then spriteInvert = false end
            end
        end
    else
        mx = mx - 0.15
        if timer <= 0 then
            if spriteInvert == false then sprite = sprite + 1 else sprite = sprite - 1 end
            if sprite >= 18 then spriteInvert = true elseif sprite <= 13 then spriteInvert = false end
        end
    end
    my = my + ( dy * 0.15 )
safe rover
#

Will take a look

cunning wind
cunning wind
# cunning wind

IMO, I think this one takes the priority, since unlike the other, to which I managed to fix it at least, the custom looping sound effect not stopping is something else.

safe rover
#

Yeah saw that too, gonna guess it is related

safe rover
jovial echo
#

ya, I've realised that BonMelancholic

safe rover
cunning wind
#

Anyway, as I took a deep look onto the code, apparently, it all came to awkward arrangement of functions.

cunning wind
safe rover
#

Ah alright, I'll dismiss it in that case!

jovial echo
#

I'm currently trying to retexture squid mother,
but when displayed, the hatch is offset.
So I tried offsetting the texture to fix the issue.
The offset didn't change.

safe rover
#

Yeah, that texture is an unfortunate one, as it uses it's own size as an offset too
hatchOffset should valid custom behaviour data though

#

Note that there is a ReclayedSquidMother and a SquidMother

jovial echo
#

I tried changing the hatchOffset values, but to no avail

#

I'm talking about the Reclayed one

#

-# I'll give it a 5th try just to make sure

safe rover
#

Let me try it real fast

jovial echo
#

want the textures DMd to you?

safe rover
#

Texture shouldn't matter too much, no worries

jovial echo
#

oki

jovial echo
safe rover
#

Worked for me just now, the hatch is behind boss, not sure what your setup looks like

jovial echo
#

the layer position is not the issue

#

the hatch is just offset, despite me changing the values

#

changing the texture itself, so the hatch is off center

safe rover
#

Hmm, maybe do send me your sprites!

#

How is it looking?

jovial echo
#

?
-# the sprites are DMd to you

safe rover
#

Ah, didn't see the message request

crimson linden
#

As in, both the squid and the turret ones?

jovial echo
#

but, the issue is solved now

#

thanks to
-# I remember that people can be pinged without using the @

crimson linden
#

Yup, it's the mention reply
You gotta disable it manually each time fish

cunning wind
cunning wind
#

Pinging @safe rover for this...
So I used the exact same bullet hit behaviour as enemy_bullet.lua, and found out that sonic pulse does not block the Lua-made bullet entities.

function OnHitByBullet(bulletEntity)
    if bulletEntity.data.behaviourName == "PlayerShotSonicPulse" then
        CreateFlash(self.worldPosition.x, self.worldPosition.y, self.movement.x, 0)
        self.Deactivate()
    end
end
#

In fact, entites using the enemy_bullet.lua example script are not erased by sonic pulse. clay_spiral

crimson linden
#

Is it really called "PlayerShotSonicPulse"?

cunning wind
#

That's the behaviourName of PlayerShotSonicPulse

#
  {
    "name": "playershotSonicPulse",
    "sprite": "Effects/Bullets/sonic pulse",
    "sortOrder": 11500,
    "behaviour": "PlayerShotSonicPulse",
    "customBehaviourData": {
      "baseDamage": 1.5,
      "baseDamagePods": 1.0
    }
  }
frail matrix
#

Try the entity name instead

#

Oh wait it says behaviour name, it wouldn't work

cunning wind
#

Hi there. Didn't know you're probably gonna stay up late until 3:00 am in your place. :3

frail matrix
#

I'm already sleeping
-# half way there

cunning wind
#

I see.

#

I assume you woke up prematurely fsr.

frail matrix
#

Nah i'm just sleeping late today

cunning wind
#

Gotcha

cunning wind
frail matrix
cunning wind
#

I noticed that some Lua examples from the beta do have some inconsistencies with their vanilla counterparts.

#

reclayed_turret.lua for instance will often miss the target player since its target position uses the player's "regular" position, and not world position.

#

And we all know that position isn't the same as worldPosition, which is far more consistent than the former.

safe rover
cunning wind
#

This is its logic layer:
self.SetLogicLayerEnemyShot()

#

Which is exactly identical to the one used in enemy_bullet.lua.

safe rover
#

Ah yeah.. I see what's going on

#

behaviourName resolves into the "real" name not just the one in entities.json so the correct comparison to make is: if bulletEntity.data.behaviourName == "PlayerShotSonicPulseBehaviour" then

cunning wind
#

It now works! anthony_kiwi

#

TYSM

safe rover
#

There is an update on the way to adjust the example as well, I forgot to mention

jovial echo
#

I mean, it doesn't look upscaled, like I don't see any quality loss

cunning wind
#

IIRC, I used adaptive sharp setting.

crimson linden
#

In photoshop?

cunning wind
#

I actually used a simpler program, which was Paint.NET.

crimson linden
#

I have it too but I never dived much into it
Will give it a try, at least for scaling 👍

cunning wind
#

Many advanced image editing softwares take time to start up.

cunning wind
#

Nice custom loading screen you have in Autodesk Maya. :3

#

Yes, I am familiar with Autodesk as a company.

final osprey
#

Photoshop takes forever too.

#

Gimp heh kinda in between, not as long but not as short either, lol.

jovial echo
# night stream

I imagine you having an attack similar to Papyrus from Undertale, where he turns his opponent blue.
You would turn your enemy green of course BonWink

final osprey
#

Da ba dee

cunning wind
#

Anyway, we should be moving to a different channel if ever we continue talking about miscellaneous stuff.

jovial echo
#

do we have a command like "if specific enemy is dead, then-"?

cunning wind
#

We already have something like that, known as ifNotSpecificEntityOnScreen("entity": "", "places": 1);

crimson linden
jovial echo
#

How does colouring the player ships in the select screen work?

#

like how to determine which colour must be changeable

#

or is it hard-coded that red is always primary etc

cunning wind
#

Red is always primary, green is secondary, then blue is tertiary.

#

They will always be that way.

#

But, you can assign these colors onto your model.

#

Kind of like this:
-# An excerpt from Platypus Casinopolis

jovial echo
#

yup, I'm aware of that

#

I'm just afraid that it will misread other colours

#

like brown - it has some red in it

cunning wind
#

So you're planning to more than 3 colors?

jovial echo
#

yup

#

and that 4th colour is planned to stay the same through all skins

cunning wind
#

🤔

#

I haven't tested that scenario thoroughly before tho.

jovial echo
#

As far as I remember, probably no one has before

#

though wait

#

How does witch broomstick work, isn't it like a 4th/not mentioned in the json colour?

#

as tertiary - cloth
secondary - skin

cunning wind
#

I think what happens is that both the primary and secondary colors are sort of disabled.

#

It goes something like this:

    "uiSecondaryColorHigh": "#00ff00",
    "uiSecondaryColorLow": "#00ff00"
jovial echo
#

yup, they're kinda just unchanged

cunning wind
jovial echo
#

so the broomstick is brown by itself and not affected by the code

cunning wind
#

Seems like it.

jovial echo
#

so to keep things simple, how to make sure that the code doesn't change brown?

cunning wind
jovial echo
#

okay
I'll have to make some work-around
as to set the secondary colour as the main changing one etc.
but doable

cunning wind
#

Good thing you only have one changeable color in mind.

jovial echo
#

ya, as most of the player ships just change the "main" colour

#

btw, Bananawar will have 7 different ships to choose from

cunning wind
#

IG no one else knows what is the 7th ship in your mod. :3

jovial echo
#

I'm currently trying to set the ship SelectScreen colors from scratch, it's tedious.

#

I try to match my sprites, which use slightly different lightning

cunning wind
#

👀

jovial echo
#

tbh, despite how bad it sounds, I'm considering just making sprites for each colour

cunning wind
#

How to set custom diff dict data in Lua?

jovial echo
#

"Add Trail behaviour that offers customizability though customBehaviourData as well as being able to being spawned as a child of any other entity"
Could someone explain to me how to use it? Is it possible to make a connected chain of enemies?

#

that's what I tried.

cunning wind
#

It's basically a homer trail, but can be attached to a different entity.

jovial echo
#

awh.

cunning wind
#

function OnDestroy() has officially been added. BoomSpin

frail matrix
#

using self.animator.rotation on an entity

the next entity will mantain that rotation of the previous rotable entity

alas is not resetting it rotation value between lua entities

cunning wind
#

I wonder if the devs could just make the entities without that value always have the rotation set to 0.

cunning wind
opaque island
pearl ether
#

can we had the editable boss 2?

jovial echo
#

now that I think of it, shouldn't it be possible with the train code?

cunning wind
#

Oh boy, the Lua rotation persistence bug seems to affect vanilla child entities too. clay_grimacing

#

And yes, that turret uses ReclayedTurret vanilla behaviour.

cunning wind
#

Yet another reason why Lua rotation persistence bug should be fixed. chipMint

#

FYI, the child entity is now a Lua entity with the manually coded default rotation.
i.e. self.animator.rotation = 0

#

Actually, all the entities onscreen have said rotation defaults.

P.S.: Okay, I guess that glitch may be dismissed, since I found a solid workaround for the fix.

cunning wind
#

Okay, I've been wondering what are the valid commandArgs for enemyZap behaviour?

crimson linden
#

Does anyone know how to change the offset and/or sprites of the water splashes generated by the submarine? or is it hardcoded?

frail matrix
#

splashes as in the, moving water sprite?

crimson linden
#

ye