#Custom Enemies Support/Thread

1 messages · Page 1 of 1 (latest)

arctic ingot
#

Repurposed thread to ask for support for custom enemies, show them off too!

buoyant lake
#

Correct afaik but maybe we can add a way around that @safe rover ?

safe rover
#

Addons can add new entities and redefine existing entities from their entities.json file

#

So you can make new enemies without replacing the original enemies!

arctic ingot
#

thats great to know, its just you cant give them new sprites or anything?

arctic ingot
#

I guess one thing I really need to ask, can you make enemies fire different bullets? Like can I make a saucer shoot something else and how, can I mount a turret onto something else like an un? Or do I need to make it "behave: like an enemy that can shoot rockets?

For example, I want to make a saucer that fires homing rockets

upper leaf
#

You can make new enemy definitions, give them new graphics and change some things about them, you can make new bullet types and new gun types, but you can't make any enemy fire any kind of gun.

Actually I would be quite interested to know what things people actually want to change as we may be able to add some extra functions in an update

safe rover
#

You can give them new sprites as well, what you can't do is write completely new behavior code. You can also give your enemies guns via the "turrets" property

#

I think the saucer has their bullet hardcoded, but you can mount turrets to uns without issue

arctic ingot
#

I dont want to ask for anything demanding, Im not sure the limitations of this game is but if there is a way to define the entities enemies can shoot I think thatd be really great!

Maybe in the meantime if some one on the team can find time for more thorough documentation on some things like the limitations of enemies and mostly what enemies are capable of and how to toy with them, I'm a bit lost at what enemies can do exactly. I did see some one swap the turrets of laser squids with existing turrets but I dont have a clue how you could make compatible enemies fire a new thing without giving them a turret, if they can be given one.

safe rover
#

It is a bit of a trickier thing, enemies are based on really old code and then modified from there for backwards compatibility. So for that reason behaviours use data (and hardcode data) in very different ways.

"turret_entities.json" has a few examples of turrets that all have a "bullet_entity" parameter, those all came way later in the development cycle, so these all are mostly consistent

#

It is possible to create a turret entity without a sprite to get the flexibility of bullet entities on behaviours that usually don't have the capabilities

arctic ingot
#

I see so if you want to give an enemy a way to shoot a different projectile you can give it a turret and do some trickery to hide the turret and such by making a new one? is there any know limitations to what enemies can be given turrets or can nearly anybody basically, like realisticlly most enemies not something like putting a turret on a homing rocket

#

but I mean something like you could put it on a saucer or a un, or you can give an enemy multiple turrets?

safe rover
#

Any entity can be given "turrets" including fun things like.. bullets, explosions, shards or the bonus text 🙃

#

it is an array, so you can also add multiple, the bigPinkShip is an example of this

#

The turret entity is also not limited to being a turret, but I have not much played around with what happens when you start nesting enemies

arctic ingot
#

okay this sounds great lol, thank you for the clarifications

#

if you may excuse me for a quick moment to show an example of something that works...

#

so something like this?

safe rover
#

That looks about right, yes.

  1. You will need to define "saucerhoming" separately
  2. The JSON parser is very very strict, so because there is a trailing comma all the way at the bottom, you will get errors
arctic ingot
#

yeah I understand json format, I plan to make some more enemies

#

about the Turret X and Turret Y coordinates, do they need to be defined is it like multiple turret positions being defined with those?

#

I copied this from the homing ship, the one that flies from behind and fires two rockets

safe rover
#

You essentially spawn another entity "turretEntity" that follows the parent exactly, turretX and turretY are the offset to the parent

#

So 0 and 0 will make the turretEntity follow exactly the center of the parent

upper leaf
arctic ingot
#

okay its the location of that singular turret, I dont really have anything else to ask then, I guess the thing about "behavior" is this something that can be put on another enemy or you'd have to make an enemy that behaves like this, can look like another one.
So hypothetically some one could make a squid enemy but it looks like a saucer or vise versa?

upper leaf
#

behaviour refers to which enemy behaviour script it is using. These are all hardcoded, but in theory you should be able to attach one behaviour to a completely different enemy, although weird things may happen if some of the behaviour code is expecting a different enemy. But you should be able to attach something like a gunship or squid behaviour to pretty much anything and it will move like they do.

I wanted to - this is something we might look into if modding community takes off - create a few new generic enemy behaviours with some stock movement patterns that you could apply to new enemies for this purpose. But ATM you are limited to the existing behaviours. Try some out and see what happens

#

Oh, and I absolutely would have added some new enemies to Desert Mission if I had time... I may come back and do an update which has something new

arctic ingot
#

but I greatly appreciate the answers! Here I'm gonna rename this thread so others that want to know about enemies can find this stuff, this is all very useful!

#

Question About Custom Enemies

arctic ingot
#

How do you go about spawning said custom enemies? Im a bit confused with trying to figure out and been doing a handful of things. I figure randsaucer is hardcoded to saucers only, but for "string name" in the level documentation page, is it just to refer to the custom enemy's name or do you need to put that phrase in there?

safe rover
#

look for the spawnEntity command

upper leaf
#

there's a little bit of inconsistency with the commands derived from the original game script vs the newer, more sensible additions

arctic ingot
#

btw how does one move a custom stage to be after everything else plimbo

#

oh did the video really corrupt? cmon

safe rover
#

Played back for me, looks good

buoyant lake
#

Works here and looks good

safe rover
#

Would be nice to be able to disable the regular firing straight out, so you don't have that initial shot. Not sure that's possible on the saucer behaviour right now

buoyant lake
#

@safe rover Just FYI I'm very happy for you to do minor additions related to modding without asking anyone - as long as properly tested and documented. Best to just do them, permission not required. @opaque island can double check them or be a sounding board.

buoyant lake
#

@upper leaf 's mentioned a few things, like some generic adaptable behaviours (data lead), saucer's being a bit hard coded, etc. Could add a few 'new' entities that are more easily configured by modders. Plus threads like this 🙂

arctic ingot
#

If theres some suggestions I may provide
Maybe a string for enemies to force them to be bigger/smaller in both their art and hitbox so people dont have to worry about resizing enemies in sprite sheets? Idk how I managed to make the yellow small un work but I just followed what the others were like but didnt see a hitbox sheet for other enemies
honestly I cant think of anything else I just started

#

Is there a way for the spawnentity level command to have random coordinates like saucers and fish? Maybe that could be one too if its not a thing

buoyant lake
#

@arctic ingot Can you add the support tag to this thread?

arctic ingot
#

there claythumbsUp

safe rover
#

Size adjustments are a bit tricky since they are very tied to the source sprite dimensions, but in animations.json you can kinda control it with "pixelsPerUnit" Reclayed generally uses 4.5 while Original generally uses 1

arctic ingot
#

Custom Enemies Support/Thread

arctic ingot
safe rover
#

There is a SpawnEnemyEntitiesAtRandomCommand but it is only available through code, sounds like a simple addition!

upper leaf
#

or would that affect the turret also

arctic ingot
#

is the fire chance the fire pattern?

upper leaf
#

wait( 0); setFiringChanceSaucer("easy": 30, "normal": 40, "hard": 50, "nasty": 60);

#

its a % chance that they will fire, each time they have a chance to fire

#

that might stop the missile as well though, I'm not sure... I never put a missile on a saucer!

arctic ingot
#

oh do certain enemies not normally fire unless set to have a fire chance?

upper leaf
#

this applies only to saucers, and there's a similar command for the random fish

Most enemies always follow their attack sequence. Saucers and fish have several chances to fire, and only fire sometimes. It's so they don't all fire at the same time, and you can adjust the overall number of bullets on screen better

#

so you can make a small number of saucers shoot a lot, or a large number shoot only a little

#

want to put missiles on the rays now...

arctic ingot
#

I just thought of another suggestion, maybe something that allows for some very basic projectile fire direction. I wanted to create a bomber enemy that rains projectiles from above but I dont think I can make a bullet that goes down can I?

#

Also a force direction if possible, like making a gunship move left instead of going right and then modders can just make the sprites for a respectively facing gunship themselves

upper leaf
#

Yes, very good point, I'm not sure if you can force direction, although for bullets that fire in a fan or randomly you can set the spread angle but not sure if you can direct it... would definitely be a useful thing to add

arctic ingot
#

okay this one is a real genuine question, when making a new enemy and you need to refer to an animation, I assume all enemy animations are hardcoded and theres no way to change the way an enemy's sprite sheet is read, so if I really wanted to do something ridiculous as Im trying to envision here, it needs to be built directly off the respective enemy's sheet? Also assuming "generateColliders": true, has a limit to the size of what its reading, so even if I made this new enemy smaller than the green squid, it'd still be around the green squid's size?

upper leaf
#

@safe rover knows better than me how the colliders work. It should generate a collider that matches your shape, hopefully. But you can supply a separate collision sprite sheet.

The sprite sheets are flexible, you can change the size, dimensions, number of rows or columns, and change the total number of damage frames as well. As long as you set it up correctly in animations.json everything should work automatically

arctic ingot
#

I tested the other trail bullet that splits up as it travels and it made a painful bullet hell, so definitely saving that for a miniboss version or just for a boss lol

buoyant lake
#

I'm liking what you're doing here

whole coyote
kindred bridge
cunning wind
#

Imagine squids that shoot huge bullets akin to the Squid Mother's secret weapon.

kindred bridge
#

imagine that green trashcan that flings mines

#

or those bubble shooter squids

#

and the homing rocket squids

cunning wind
# kindred bridge or those bubble shooter squids

I'd like to call them mortar squids, since they are fired more similarly to an actual mortar. Like, it does not really make sense calling them cannon squids, because the term cannon may refer to anything that shoots.

kindred bridge
#

yea good idea

cunning wind
#

In that sense, I would also personally refer to cannon boat as mortar boat.

kindred bridge
#

what if we had a squid type that would like rush forward and liek explode in a aoe

kindred bridge
arctic ingot
cunning wind
#

Its exposed thruster gun.

pearl ether
cunning wind
#

Yeah, sadly.

#

But enemyshot_huge_bullet is a bulletEntity, so yeah.

pearl ether
buoyant lake
#

@safe rover we could un hard code this?

safe rover
#

un-hardcode, what exactly?

buoyant lake
#

Squid weapon if hard coded

safe rover
#

Sorry I don't follow, you mean to make boss 4, the squid mother less hardcoded?

buoyant lake
#

If it's not obvious then it's probably not something to un-hardcode! I think custom bosses really need people to go into the C# or we spend a bit of time on a generic boss as anthony suggested

pearl ether
cunning wind
#

Didn't know that, but thanks anyway.

#

Oh wait

#

From entities.json

pearl ether
cunning wind
#

Damn, that spelling

#

Wait, would the accellerator bullet be used by Starfishes?

cunning wind
pearl ether
cunning wind
#

Okay then. I was worried that both of us would be naive with these lately.

pearl ether
pearl ether
arctic ingot
#

can any enemy be defined as a boss or must it be a boss entity? Like when it gets to the boss area of a level you could make the game treat a squid or something as a boss

pearl ether
#

oh found it!

#

HOMING!

safe rover
#

Anything can be a boss! Boss entities are not different from regular ones

pearl ether
#

just make them have a huge hp

arctic ingot
#

Any developers here know how to make the game read a sprite sheet a new way? Like I just want to have a turret that is this, but using the squid gun its trying to animate it like one, are there alternatives or a way to make it not animate?

safe rover
#

The behaviours control how things are animated, so you would have to use another behaviour. But I'm not sure there is one that'd do this for you

upper leaf
#

I guess the hacky solution would be to make an animation sheet with each frame the same

buoyant lake
#

Sounds like the kind of game dev hack I approve of

upper leaf
#

wouldn't be the first time something like that happened

arctic ingot
#

is there a difference between backGreenBigUn and greenBigUn?

#

I assume the back one, backs away instead of continuing to the right?

cunning wind
#

Background maybe?

#

Does the backGreenBigUn have the "isenemy" flag or smth?

arctic ingot
#

I forget these level files are more for than just enemies

upper leaf
#

the back ones are the ones that appear in the far distance; they have no effect on gameplay

arctic ingot
#

okay this isnt related to this thread but Ive asked so many questions here and a lot of devs are here (I think there needs to be a centralized thread or channels dedicated to general modding imo) but about tile groups, when a level is listing the numbers 1, 1, 1, 2, 2, 3, 5 etc. Is it referring to the number in a scenery like how colossatropolis has building 1 in its stage gfx, so 1 is associated to building 1 because of that number? And can you make a level load multiple tile sets at once or will that cause visual issues because multiple tile sets will conflict with numbers?

buoyant lake
#

May have to break modding up into mod support and mod announce tomorrow. Got more posts than expected!

arctic ingot
#

yeah that would be really nice to split help and mod releases

#

I suppose its too late to also do a text channel for generalized modding discussion?

buoyant lake
#

Tomorrow then. I have a whole host of production tasks to do if I manage to sleep tonight....

buoyant lake
arctic ingot
#

yeah understandable, it can be a clutter adding too much 😵‍💫

buoyant lake
#

I think two forums is fine for now. Main platypus channel still ok for chat. We'll see how busy it gets

upper leaf
#

when a level is listing the numbers 1, 1, 1, 2, 2, 3, 5 etc. Is it referring to the number in a scenery like how colossatropolis has building 1 in its stage gfx

Yes. And the ones listed multiple times are more likely.

arctic ingot
#

how does a level pause enemies from continuing to spawn? Usually happens when big enemies/minibosses are thrown around but mine just keeps trucking

hazy sage
#

There is a function/ script that goes something like "wait for no enemies" if you look through reclayed level files there should be a line like that

#

Cant tell you much since im out of home, but usually you can use that BEFORE you spawn the boss you desire

arctic ingot
#

I do have that but enemies continued to spawn

#

I wanted atleast a few lads to come in during the fight but then after the level keeps going

hazy sage
#

Maybe the wait time is a bit too low? I can see its set to 1 but cant guarantee if that changes

arctic ingot
#

for the waitfornoenemies?

#

I copied it from the existing levels, been building my level off level chunks from the main adventure and editing it

pearl ether
#

tbh waitforenemies is just an if function wether the enemies is still on the screen

arctic ingot
#

I think I figured it out, I just put another after the boss so it holds everything after from spawning until theyre all dead

pearl ether
#

if you want a specific enemy on the screen then ifSpecificEntityOnScreen("entity": "entity name", "places": how many idtem it will spawn);

#

example
ifSpecificEntityOnScreen("entity": "octopus", "places": 2);

#

wait( 100); monorailCart("railSpeed": 0.030, "childEntity": "monorailOctopusWeaponPod", "childArgs": { "weaponEntity": "octopusGunShotgun", "yoff": -60 });
wait( 300); monorailCart("railSpeed": 0.035, "childEntity": "monorailOctopusWeaponPod", "childArgs": { "weaponEntity": "octopusGunMissiles", "yoff": -60 });

arctic ingot
#

is there a reason to spawn a specific entity if you can just spawn them with spawnentity?

pearl ether
#

like octopus he needs OctopusWeaponPods the game will spawn those weapon pods to be used for octopus

#

as long as that Octopus or specific entity is alive

#

aka on Screen

arctic ingot
#

oh so they will continously spawn without need for scripting

pearl ether
#

yes

#

unless you change it to the other ifSpecificEntityOnScreen

arctic ingot
#

and when the enemy dies it will stop, what does the "places" do for it? I dont need to specify a thing?

arctic ingot
#

well I didnt really want to use this yet but knowing it for later would be good for a mid level boss

pearl ether
#

like OH I WANNA add 999999 SQUID when the octopus is alive

#

"places": 99999
then spawn the squid 9999 times under it

#

the squid(function)

arctic ingot
#

places is how many it spawns in a batch?

pearl ether
#

yep

#

under the ifbatch

arctic ingot
#

so whats the places referring to

pearl ether
#

both

#

both entities name "octopus'

arctic ingot
#

but it cant be spawning itself? is this a custom level youre showing?

pearl ether
#

but only spawn once not twice

#

on the batch

pearl ether
#

if you still curious

#

it's right there

arctic ingot
#

well no this just really isnt making sense to me what places is or what is the thing that its spawning is for the boss being alive because it definitely isnt spawning himself

pearl ether
#

ifSpecificEntityOnScreen("entity": "octopus", "places": 2);
wait( 100); monorailCart("railSpeed": 0.030, "childEntity": "monorailOctopusWeaponPod", "childArgs": { "weaponEntity": "octopusGunShotgun", "yoff": -60 });
wait( 300); monorailCart("railSpeed": 0.035, "childEntity": "monorailOctopusWeaponPod", "childArgs": { "weaponEntity": "octopusGunMissiles", "yoff": -60 });

pearl ether
arctic ingot
#

is the places2 referring to the two lines of code

pearl ether
#

yes

#

place 1 is refers to the one line of code

arctic ingot
#

okay when you said it spawns itself that really lost me

pearl ether
#

the demonstration is best to make you not confused

#

it can spawn enemies

arctic ingot
#
    wait( 100); spawnEntity("entity": "rocketsaucer", "y": 240, "x": 900);
    wait( 50); spawnEntity("entity": "rocketsaucer", "y": 240, "x": 900);```
pearl ether
#

try it

#

means if medtick is alive it spawn those

hazy sage
#

Oh also strange question but i wanna know the "wait( number )" ... what time does it use (like seconds or miliseoncs etc)

arctic ingot
#

it definitely doesnt seem like seconds

#

I do notice another thing, level pacing seems to slow down a lot when goldfish are present? Like Ive been trying to use them but things start to go to a crawl despite putting something like dozens of saucers in, they get spaced out or something

upper leaf
arctic ingot
#

or it did but didnt loop

arctic ingot
#

okay it is working its just not looping

pearl ether
#

Again it just if statement not loop statement

safe rover
hazy sage
#

Ohh okay great tysm

pearl ether
#

speedKillTimer = if you don't kill the boss in specifitime = he'll left

kindred bridge
#

wonder how we will make enemies have new movement ai without dll modding

#

i wanna recreate those mini orange gunships without guns from ii

arctic ingot
#

I think the only way to make new enemy ai is to edit the code itself

#

otherwise you need to use what there is

kindred bridge
#

aight

buoyant lake
#

Currently this is the case. We may be able to offer something more but we have a couple of weeks of other patches likely first (no guarantees)

kindred bridge
#

i bet my chances that we get a patch that makes enemy ai moddable yayayayaya 🤑

buoyant lake
#

maybe in some simple way

kindred bridge
#

you can make enemies rn its just that their just modded clones of preexisting enemies to an extent

#

like those rocket saucers

#

i can see how the FLOATER MINI-UNS from II (the lil orange guys that appear) can be remade

#

im talking about the zippers

#

its better to call them MINI-UNs because its a epik pun LMAO

kindred bridge
#

Will we get the chance to make homing rockets from enemies seperate enemies

buoyant lake
#

Once we've got through the next 2-3 weeks we'll turn towards adding some modding features and some enemy stuff will be number 1. So we'll look through this thread and see what's come up

pearl ether
#

cool

pearl ether
#

{
"name": "goldFishSpawnBoss",
"sprite": "Sprites/Enemies/goldfish",
"behaviour": "GoldFish",
"explosionEntity": "explosionSmall",
"sortOrder": 9000,
"speed": 1,
"isEnemy": true,
"nudgeOnHit": true,
"maxHitPoints": 9000,
"deathBulletEntity": "deathBullet",
"highlightPoints": false,
"points": 100,
"secondaryTargetValue": 1,
"customBehaviourData": {
"turretData": {
"bulletCount": {
"easy": 1,
"normal": 1,
"hard": 1,
"nasty": 1
},
"bulletSpawnDistance": 0,
"bulletOriginOffX": 0,
"bulletOriginOffY": 0,
"bulletSpeed": {
"easy": 1,
"normal": 1,
"hard": 1,
"nasty": 1
},
"bulletSpreadAngle": 120,
"bulletEntity": "sub"
}
}
}, how to add a boss via an enemy

cunning wind
#

Bullet entity being an actual enemy huh? That's definitely dope. And yes, keep up your good work!

pearl ether
#

hardest boss?

#

need homming Missle

hazy sage
#

Dpes anyone know the turret entity for this guy? I cannot find it for the life of me

wanton basalt
#

hi ive got questions

hazy sage
wanton basalt
#

run the game with cheats on

hazy sage
#

How do i enable cheats lo

hazy sage
#

O

wanton basalt
#

if you're not playing on PC then idk

hazy sage
#

ty tho I never knew that 😭

wanton basalt
hazy sage
#

I just need something to tell me what went wrong especially when making custom enemies

wanton basalt
# wanton basalt hi ive got questions

anyway i want to make a gunship that fires in a more "bursty" fashion - with faster and bigger bursts but a long delay between them. currently if i just copy the normal gunship's code, change the name and nothing else, it does this. absolutely clueless as to what is wrong

#

entities_turrets.json

  {
    "name": "turretMachineGun",
    "sprite": "Sprites/Enemies/turretSingleSmall",
    "explosionEntity": "explosionMedium",
    "behaviour": "ReclayedTurret",
    "customBehaviourData": {
      "fireSprite": "Sprites/Enemies/turretSingleSmallFire",
      "shadowSprite": "Sprites/Enemies/turretSingleSmallShadow",
      "shadowOffsetX": -5,
      "shadowOffsetY": -5,
      "turretData": {
        "bulletCount": {
          "easy": 1,
          "normal": 1,
          "hard": 1,
          "nasty": 1
        },
        "bulletSpawnDistance": 35,
        "bulletOriginOffX": 0,
        "bulletOriginOffY": 0,
        "bulletSpeed": {
          "easy": 4,
          "normal": 6,
          "hard": 8,
          "nasty": 10
        },
        "bulletSpreadAngle": 20,
        "bulletEntity": "enemyshot_normal"
      },
      "firePattern": {
        "easy": [ 20, 20, 20, 240 ],
        "normal": [ 15, 15, 15, 15, 15, 180 ],
        "hard": [ 10, 10, 10, 10, 10, 10, 10, 120 ],
        "nasty": [ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 120 ]
      }
    },
    "isEnemy": true,
    "highlightPoints": false,
    "points": 500
  }
]
#

entities.json

  {
    "name": "machineGunShip",
    "sprite": "Sprites/Enemies/zapship",
    "behaviour": "GunShipReclayed",
    "turrets": [
      {
        "turretEntity": "turretMachineGun",
        "turretX": 5,
        "turretY": -1
      }
    ],
    "explosionEntity": "explosionMedium",
    "mainDebrisEntity": "debris_red2_1",
    "secondaryDebrisEntity": "debris_red2_2",
    "damageEffects": [
      {
        "frame": 4,
        "parachuterChance": 0.33,
        "parachuterX": 40,
        "parachuterY": 0,
        "shards": [
          {
            "entity": "debris_red2_1",
            "x": 44,
            "y": -27,
            "mx": 2,
            "my": -6,
            "frame": 9,
            "type": 1
          },
          {
            "entity": "debris_black_2",
            "x": -80,
            "y": -5,
            "mx": -4,
            "my": -4,
            "frame": 8,
            "type": 2
          }
        ]
      },
      {
        "frame": 5,
        "parachuterChance": 0.33,
        "parachuterX": 40,
        "parachuterY": 0,
        "shards": [
          {
            "entity": "debris_red2_1",
            "x": -38,
            "y": -30,
            "mx": -3,
            "my": -6,
            "frame": 9,
            "type": 1
          }
        ]
      }
    ],
    "sortOrder": 8100,
    "speed": -2,
    "isEnemy": true,
    "nudgeOnHit": true,
    "shieldPenetrating": true,
    "maxHitPoints": 500,
    "highlightPoints": true,
    "points": 500,
    "primaryTargetValue": 4
  }
]```
#

oh i forgot to change the sprite name thats one issue

#

nothing changed

wanton basalt
#

hang on I changed nothing and it's working now what

#

is there a way i can change how fast the turret turns

pearl ether
pearl ether
#

It spawn on 0,0 coords

#

For bigplane (boss 2)

#

Could be use as a suprized attack afteer waitforenemies();

wanton basalt
#

(nasty difficulty)

#

how do i make a custom enemy shoot lightning? can't get it to work

wanton basalt
#

not what i had in mind 😭

#

at least this works

#

looks like a lot of stuff is hardcoded unfortunately

#

I want to make a goldfish that shoots lightning but I don't know if it's possible

arctic ingot
#

if the enemy doesnt have a turret defined on it, its probably is hardcoded to shoot its shots

#

I heard one dev had plans to soft code some things or atleast allow you to make enemies not shoot their hardcode shot but dont expect it for a while

wanton basalt
#

i figured

#

a lot of things seem to be hardcoded and can't be changed

#

I made this but there's no way to remove the extra turret it gets on hard/nasty so i guess don't play the level above normal when its out

#

it seems like the only way i can make an enemy with a lightning attack is by giving something trashcan's turret or a big starfish turret, so i will do that

crimson linden
#

dang, I hope they make that more customizable soon!

#

if possible

wanton basalt
#

if i make a copy of goldfish's code and tell it to shoot lightning, it just flashes blue and doesn't actually shoot anything

#

there's more important things the devs should worry about, but maybe someday they will work on mod support

#

dang, trains are so hard coded i can't even use an empty car and give it a custom sprite

crimson linden
#

Can you make a brand new sprite that works like the train, though?

#

but isn't the train sprite per se, obviously

buoyant lake
#

Alternatively, hang fire for a bit and when kroporo reads this thread in a couple of weeks he may be able to do something for you 🙂

wanton basalt
#

for now im hoping if i make a mod it will inspire others to make more mods

#

additionally im using the importLevel command in my next level so people can use my mod as an example of a way to use it

#

this is my way of "spawn powerup every x seconds until no enemies on screen"

#

a better way to do this would be appreciated

arctic ingot
wanton basalt
#

are thruster ships h ardcoded to sit at the right side of the screen? i want them to sit on the left but they won't

#

wait( 180); spawnEntity("entity": "thrusterShip", "x": -200, "y": 200, "focus_y": 300, "focus_x": 150);

hazy sage
#

Hol up i wanna make something like that when i can

wanton basalt
#

you have to choose a carType for the train module and it overrides the sprite

pearl ether
upper leaf
# hazy sage Dpes anyone know the turret entity for this guy? I cannot find it for the life o...

some things are hard-coded and I think that particular gun is one of them. It has that recoil animation. I believe that particular enemy was added to the game before the generalised turret system.

Some of these things are quite easy to address, what we need to do is figure out the most-useful and requested features. It would be interesting to know how much of Platypus 2 could be recreated with existing mod functionality and what would need to be added for instance.

There's a lot still left to explore too I'm sure. I wouldn't have thought to put starfish lasers on the train but that looked awesome. I have never even had time to make any new goldfish formations yet but you can make new flight paths for the goldfish

pearl ether
#

@hazy sage

upper leaf
wanton basalt
#

i would also like an option to prevent turrets from holding fire during a burst if they're not pointing at the player, dunno if anyone else will use it tho

upper leaf
wanton basalt
#

yeah, plus you have bigger priorities for now, i'm aware of that

upper leaf
#

I really like what people are doing with mods so I hope it does take off; as soon as we've sorted these patches I'll be making some new mod art

cunning wind
#

Any chance for rotatable lightning turret support?

cunning wind
#

I think what I mean is the turret fires lightning while also rotating simultaneously, thereby sweeping across an area.

upper leaf
#

We'd need to make a proper 5 pronged turret sheet first; that one doesn't have all the frames required. Can you make a single-barrel lightning turret I wonder? I guess not yet

wanton basalt
#

afaik big starfish turret is currently the only way to make a lightning turret

#

I've also tried making a goldfish that shoots trashcans turret, it doesn't shoot lightning, it just summons a permanent lightning gun then leaves while the lightning gun periodically fires forever

wanton basalt
wanton basalt
#

fun fact when you use makeTrain(); you should triple check that the amount of fruit sets defined lines up with the amount of train cars, because otherwise this happens

safe rover
#

The error log must be screaming right now

arctic ingot
#

Did anything with enemy entites get changes with the newest update in regards to the addition of the new difficulty or is everything the same? Like is Easy now referring to Regular and Normal to Hard and so on? Or is everything the same and very easy enemies just go off Easy?

cunning wind
#

All pre-existing difficulties were simply renamed, thus pre-existing enemy scripts and behaviors are unchanged.

arctic ingot
#

so which is which now?

#

I assume Very Easy is going off Easy firing patterns

cunning wind
#

Of course.

wanton basalt
#

oh so apparently the internal difficulty names are the same as the old ones, and the new difficulty is VeryEasy

arctic ingot
#

so expert is a new difficulty title too?

#

Im going off enemy attacks not really the levels

#
        "easy": [ 150 ],
        "normal": [ 100 ],
        "hard": [ 40, 80 ],
        "nasty": [ 20, 50 ]
      }```
#

like what is related to what now

#

so I assume veryeasy just uses Easy attacks
Regular is Easy
Hard is Normal
Expert is Hard
and Nasty is well, nasty

wanton basalt
#

did you redownload the mod starter pack

arctic ingot
#

yes

#

oh I forgot to reload them

wanton basalt
arctic ingot
#

yeah I see it now

wanton basalt
#

since ive heard a dev is going through this thread eventually: #🚀┃platypus-discussion message

#

I request a waitUnlessNoEnemies("frames": x, "places": y); command, identical to wait(); ifNoEnemyOnScreen(); but if there are no enemies on screen, the timer ends early and places commands are skipped

#

or, alternatively:
waitButSkipIf("frames": 600, "places": 4, "enemiesOnScreen": false, "noEnemiesOnScreen": true, "specificEntityNotOnScreen": "null", "playerDead": false);
essentially, wait frames frames while checking if any specified conditons are met constantly. If any are met, stop the timer early and skip places commands. If the timer ends while all conditions are not met, continue as normal.

In this example, the command will set a timer for 10 seconds. If at any point during those 10 seconds, there are no enemies present, the timer ends early, the next 4 commands are skipped, and the 5th command after runs immediately. If there are enemies on screen for the entire 10 seconds, nothing is skipped and the next command runs.

safe rover
#

I believe there already is a "waitForNoEnemies" command with a maximum wait time, the idea of it was to use it everywhere to tighten groups when you're fast at killing things

wanton basalt
#

I did not know that has a timeout variable because it's not used in any of the mod starter pack levels lol

#

helpful

#

I kid you not, all of the basegame levels do whatever this is

#

"this is just time waste" ok i appreciate the honesty but like why

#

if i ctrl+f "waitForNoEnemies" in lvl2's data file all of the results are this

#

i just assumed the command had no parameters because of this

safe rover
#

Fair assumption to make!

upper leaf
#

"this is just time waste" ok i appreciate the honesty but like why

I wanted to wait for a certain amount of time, but I also wanted to check if the boss was dead every few seconds

#

OFC there are tidier ways to do this but we just had to get things working

wanton basalt
#

time constraints is a valid excuse

wanton basalt
#

is it possible to customize enemy firing sfx?

bitter pewter
#

Is it possible that you can change the sprite of a projectile?

For example a missile projectile but instead of it looking like a missile its something else like the blue orbs from starfish

upper leaf
#

yes to both

#

sound effects are defined in audio.json and entities like missiles are defined in entities.json. New sprites are declared in animations.json

#

I have not tried assigning a non-animating sprite like a blue orb to an animating entity like a missile, but I think it should work if you just edit the missile definition in entities.json and tell it to use the orb sprite instead of missile sprite

wanton basalt
#

question about the mod starter pack files: why do some enemies have generateColliders set to true, then also manual colliders defined? What's the point of both automatic and manual colliders?

safe rover
#

The "collisionSprite" property simply tells it to use a different one to the normal "sprite", while the "generateColliders" property tells it to do it in general

wanton basalt
#

ah ok

#

for turret stats, what does fireTimer do? prevent it from shooting immediately after spawning?

safe rover
#

It is different from behaviour to behaviour I'm afraid

wanton basalt
#

do you happen to know what it does with SpinTurret behavior?

safe rover
#

Not currently at the office, so I can't check right now

wanton basalt
#

my favorite way of figuring out what something does is setting it to an extremely high/low number and seeing in what way it gets screwed up

safe rover
#

That works as well :)

wanton basalt
#

i set it to 999999 and nothing changed so i have no idea what it does

safe rover
#

Chances are it just doesn't use it at all too!

wanton basalt
#

i think i believe that

wanton basalt
#

Where can i find a list of fish fighter scripts

#

I'm trying to make a custom fish fighter and dont know if I can give them random spawns

#

also there's no entry for setFighterScript in the level data command reference

wanton basalt
#

ok no i cant use setFighterScript without being told how, ive tried a few things and managed to make fish fighters immediately disappear, move in a seemingly random pattern, and move in a straight line

#

I want to mimic random fish fighter behavior but nothing i try works

crimson linden
#

if you set a null script for Fish Fighters, they behave exactly the same as here

wanton basalt
#

ok but they have a script in this video

#

i think adding a -1 to the end of the script makes them not disappear immediately

#

absolutely no clue why

crimson linden
#

maybe it triggers a loop or something... not sure hmm

crimson linden
wanton basalt
#

anyway i tried making a fish script that went something like [0, 10, 20, 30... 90] and they did this

crimson linden
crimson linden
wanton basalt
#

then why do the default fighter scripts have so many 0's in them?

crimson linden
#

hmm

#

oh wait, hold on, I wonder if they're some sort of angle commands
I'm analyzing your video as I say this lol

wanton basalt
#

that's what i thought initially. the behavior im looking for is the randFish behavior, so i want them to slowly pitch up/down and that's it

crimson linden
#

have you tried [ 0, 0, 0, ....... 0, 90, -1 ] ?

wanton basalt
#

no

crimson linden
#

I thiiink it should go straight, and then down, I wonder

wanton basalt
#

i'll test it now

crimson linden
#

I'm speaking blindly though lol
but let's see! hope it works

wanton basalt
#

they instantly disappear again (like in the first video)

crimson linden
#

dang... let me think hmm

wanton basalt
crimson linden
#

I wanna see something
try [ 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0, 10 (etc) ]

#

and end with -1

#

I think I'm gonna try and experiment a bit on my side too, but I gotta learn to modify levels first lol

wanton basalt
#

ending with -1 doesnt seem to make them not disappear, so idk why all of the default scripts do that then

crimson linden
#

dang, this seems more complicated than I thought
I can't figure it out either
I'll be doing some experiments too!

wanton basalt
#

if it had an entry in the level data command reference that would be great

crimson linden
#

for sure :,)

final osprey
#

I was toying around with the fishes yesterday too..I tought it would've been easier

#

Mine disappeared as well

wanton basalt
#

im just gonna work on cleaning things up while i wait for @safe rover to respond, he's in DND so might take a few hours

crimson linden
#

@wanton basalt Sorry about the ping
at what location are you spawning the fighters? (x and y)

wanton basalt
#

600, 300

crimson linden
#

I'm asking so I can spawn them near the end of the side of the screen

#

thank yo!! I'll give that a try

safe rover
#
- First instruction is used to set the initial frame. That is `initialFrame = value-1`
- 100 at the start of a tick fires a bullet, and set the next tick wait to the value that follows. (IT STILL EVALUATES SHIP MOVEMENT)
- -1 deletes the entity once the target frame is reached
- Values below Animator.TotalFrames-1 are treated as target frames, the next value is the tick wait
- The fish moves towards target frame every tick, that forces the tick wait to be 3 for the next tick
- If the sprite sheet has 100 or more frames, you can never use frame 100 as a target frame

init:
    frame = Peek()-1

tick:
    nextTickWait--
    if nextTickWait > 0:
        return

    if Peek() == 100:
        Pop()
        Fire()
        nextTickWait = Pop()

    if targetFrame == frame:
        if Peek() == -1:
            Deactivate()

        if Peek() < Animator.TotalFrames-1 && Peek() > 0:
            targetFrame = Pop()
            nextTickWait = Pop()
    else:
        MoveTowardsTargetFrame()
        nextTickWait = 3```
wanton basalt
#

from what anthony has told me, (0, 0) is the top left corner and (900, 600) is the bottom right

safe rover
#

Those little buggers are mental, the scripting format is taken from the old game

wanton basalt
#

again the behavior i want is randFish but with a custom sprite

final osprey
#

I was attemtping randFish yesterday with the Platypus 2 green fish fighter as well

crimson linden
#

I think you can use sth like script 0 and 1

safe rover
#

If you just want a copy of randFish, but with a different sprite I think you can do it without needing to deal with that scripting language

wanton basalt
#

I could, but again I want yellow fish to fire multiple times and I don't know if randFish does that so I think i have to figure out how fighter scripts work

safe rover
#

Don't think it does. For specifics you'll have to wait I'm afraid

wanton basalt
#

It's fine I have other things I want todo

final osprey
safe rover
#

Should be doable with the spawnEntity command

wanton basalt
#

I do this. unfortunately i don't know how to use the randFish script

crimson linden
final osprey
#

I tried that and none spawned

crimson linden
#

wut
was the range not too far away?

wanton basalt
#

also tried that it didnt work

final osprey
#

I copied the range from a base level randFish

crimson linden
#

Hmm, lemme try, maybe there's something else to it

wanton basalt
#

i heard them shooting but they were offscreen, i think they were just spawning at 0, 0 and using script 0

final osprey
#

Probably yeah

crimson linden
#

huh it worked for me

wanton basalt
#

are you using black fish

#

instead of a custom entity with fish behavior?

crimson linden
#

OH yeah
you meant with custom sprites? Let me try that instead

final osprey
#

Same applies for randSaucer btw

#

Tried those too and nothing

crimson linden
#

dang, I give up 🥹
yeah it seems like the spawnEntity command doesn't read min/max X/Y coordinates.

#

I managed to spawn my custom randfish correctly, but I can't seem to give them random Y coordinates, so I guess those might have to be set manually for now

wanton basalt
#

do you at least have any idea how fish scripts work

#

I need a better "reference"

crimson linden
#

Apparently, as Kroporo showed, the answer was right above our eyes

#

but it's still a bit tricky to understand

wanton basalt
#

yeah i have no clue how it works still

#

ive managed to make them fly straight then disappear at varying intervals

#

i made this, it flies straight for 1 second, then disappears when i think it should shoot?
setFighterScript("scriptIndex": 11, "script": [ 1, 60, 100, 60, 100, 60, 100, 60, -1 ]);

crimson linden
#

Hold on, let me cook
by the way, as Kroporo said, "-1" seems to destroy the entity. So that's what's making the ship disappear, I assume

wanton basalt
#

i changed it to setFighterScript("scriptIndex": 11, "script": [ 1, 0, 1, 60, 100, 60, 100, 60, 100, 60, -1 ]); the first 5 values are the same as script 0, it should work identically until it fires, but it doesn't

crimson linden
#

oh shoot, can confirm! the further away you put "-1", the later the fish disappears

wanton basalt
#

for me adding 0s on the end doesn't make it dissapear later

crimson linden
#

oh that's another thing I'm just confirming
I think one of the numbers represents a frame of the sprite, and the other the waiting time in ticks until the next action (similar to the wait() command in level_data)

crimson linden
wanton basalt
#

if the first value is...
1 - it flies horizontally
2 - it flies up about 15 degrees
3 - it flies up about 45 degrees
4 - it flies up about 60 degrees
5 - it flies straight up, 90 degrees

#

this makes no sense

crimson linden
#

hold on, I think you might be onto something

#

lemme check something real quick

wanton basalt
#

i can't get it to not dissapear before it shoots how did you do that

#

i set the 2nd instruction to 100 and now it doesn't disappear but it also still doesn't fire what

crimson linden
#

try putting 100 in the next instruction instead
I think I'm figuring it out

#

if you do something like this [ 1, 60, 100, 999... ]
I think the fish should fly straight, wait 60 seconds, shoot, and keep moving forward

wanton basalt
#

well if i do [1, 2, 3, 4, 5... 20] it goes in a circle then disappears

#

60 frames you mean

crimson linden
#

60 ticks, yes

wanton basalt
crimson linden
wanton basalt
#

nothing changed

#

if i change 3rd value to 3 then it just flies straight until it leaves the screen

#

i'm so lost

#

what do the 2nd and 3rd values do

crimson linden
#

hmm, okay so there's something I still need to investigate about the "100"

crimson linden
wanton basalt
#

the most bizzare thing is that if i make the first 7 entries the same as script 0, it doesn't behave the same

crimson linden
#

yeah honestly that's bugging me a bit too.. I wonder if it has to do with location

wanton basalt
#

omfg you have to do setFishFire("enabled": true); for them to fire at all

#

still no idea as to why they disappear early

crimson linden
#

This is what I've decoded so far...
not sure if it's right or wrong, but I think I'm getting somewhere

crimson linden
#

also playing on a harder difficulty, since there's a bit of randomness (or set all firing chances to "100")

wanton basalt
#

if i do setFighterScript("scriptIndex": 11, "script": [ 1, 0, 100, 60, -1 ]); it instantly fires then instantly despawns

crimson linden
#

Try changing "60" to a higher number
I'll do the same

wanton basalt
#

i think scripted fish fighters dont RNG fire

wanton basalt
crimson linden
#

oh shoot, you're right!

wanton basalt
#

in the default fish scripts, the 100s seem to all be followed by a 0, ill try that

#

now it flies horizontally for a second, fires, turns straight up, then disappears

#

setFighterScript("scriptIndex": 11, "script": [ 1, 60, 100, 0, 5, 0, 0, -1 ]);

crimson linden
#

try putting "80" after "5"

#

I think it'll wait 80 ticks before disappearing, after turning up

wanton basalt
#

i might be cooking with this one
setFighterScript("scriptIndex": 11, "script": [ 1, 30, 100, 0, 1, 30, 100, 0, 1, 60, -1 ]);

#

im changing the 4th entry to various numbers and nothing is changing, i'm lost again

crimson linden
#

oh crap I think I finally get it, hopefully I got your back, buddy!

wanton basalt
#

even if i do setFighterScript("scriptIndex": 11, "script": [ 1, 30, 100, 9999, 1, 30, 100, 0, 1, 60, -1 ]); i still get the behavior in the last video

crimson linden
#

It still takes the same time to disappear?

wanton basalt
#

yes

#

also takes the same time to shoot again as well

#

it seems like the value after 100 is getting skipped

#

thats why every 100 in the default scripts is followed by a 0 probably

crimson linden
#

yeah I was bout to say
There's something weird with numbers right after 100
maybe there's a reason for it, but I can't put my finger on it

wanton basalt
#

setFighterScript("scriptIndex": 11, "script": [ 1, 15, 2, 15, 100, 0, 3, 15, 4, 15, 100, 0, 5, 15, 6, 15, -1 ]);

#

i don't understand why it doesnt turn before the first shot

crimson linden
#

because you're shooting from the 4th direction, where it's almost gone vertical, I think

wanton basalt
#

and what number correlates to what sprite? the sprite sheet has sprites for increments of about 5.6 degrees, but increasing a target frame by 1 increases the angle by 22.5 degrees

crimson linden
#

and welp, old Platypus' fish fighter has less frames

wanton basalt
#

well do you know how that works?

crimson linden
#

if I'm correct, I think it's more simple once you can see it

#

I realized when I used the number "5". It's exactly that one 5th vertical frame

wanton basalt
#

so then what angle is 17?

crimson linden
#

I assume it cycles through them, but I'm gonna test it 👍

#

either that or it disappears lol
we'll see

wanton basalt
#

it seems like the 2nd entry is also always skipped

crimson linden
#

it disappears

crimson linden
# wanton basalt it seems like the 2nd entry is also always skipped

Not exactly, unless you type in "0", I think.

See, each of the odd numbers counting from the first one seems to imply either a frame/direction indicator, or a shooting indicator.
In this script it would be 1, ,2, ,100, ,3, ,4, ,100, ,5, ,6. (let's not count the -1)

And each pair numbers counting from the second one seem to represent waiting in ticks.
In this script it would be ,15, ,15, ,0, ,15, ,15, ,0, ,15, ,15.

The only thing that works a bit weird is things right after "100", but other than that, I think I got it figured out

wanton basalt
#

ive been changing the 2nd entry to random things and its not doing anything different

#

it's being skipped im sure. but then why doesn't it turn before it fires?

#

now im changing the 5th entry to random things and nothing is changing

crimson linden
#

You're still using the same script, right?
Try using a bit more extreme numbers for waiting commands though. For example, don't go from 60 to 80, try going for 200 or a bit more.

wanton basalt
#

if i set the 5th to 16, it aims down a bit after shooting, but any other number gives the same behavior as the last video i posted

crimson linden
wanton basalt
#

at this point i think i should just wait for a dev to explain how the f this works

#

this makes no sense to me

crimson linden
#

yeah seems tricky... let me experiment a bit and see if I can come up with sth, but idk anymore lol
I'll let you know if I have any news

crimson linden
wanton basalt
#

I want it to angle up a little bit then fire, then angle up a little bit more then fire again

#

the goal is to mimic fish spawned in with randFish but make them shoot multiple times

crimson linden
#

gotcha 👍

crimson linden
#

nope, couldn't do it 🥹
this is my best attempt:
setFighterScript("scriptIndex": 1, "script": [ 1, 30, 2, 5, 100, 0, 1, 5, 2, 10, 1, 30, 100, 0, 2, 10, 3, 30, 2, 5, 1, 5, 2, 30, 3, 30, 15, 5, 16, 5, 16, 200, -1 ]);

Yeah apparently we're lacking the transition frames that randfish has. The fighter script seems to have more abrupt/fast movements instead.
Maybe if it was possible to code, we could have sub-frames, for example "1.25, 1.5 and 1.75" for the missing frames between frame 1 and 2 of the script.

wanton basalt
#

what i need is for them to turn like this

#

but if you do [ 1, 10, 2, 10, 3, 10...] it turns like this

#

i don't know which frame corresponds to which angle

crimson linden
#

yeah, exactly 😭
and no worries, I believe your frame numbers are accurate

wanton basalt
#

I'm going to bed for now

upper leaf
#

This would be a nice thing to do better, poor @safe rover had to implement the original system as written which was just based on a simple array of ints. I didn't even have to deal with it myself because it just uses all the original patterns from the old game.

But here we see the problem; the new game has many more frames and therefore possible angles, while the steering system refers to the frames of the old game.

We should probably add a V2 fish fighter which has a flight computer that is a bit easier to control.

-1 is the control to despawn themselves which would properly be done after they have left the screen.

wanton basalt
#

so is it even possible to use the new angles right now?

#

because if not then jerky movement is the best i can do i suppose

#

it's also kind of ridiculous that the most complicated command just isn't in the level data reference

safe rover
#

If you want to recolor a "randFish", then you need to use the "RandomFishFighter" behavior instead, it doesn't use the fighter scripts

wanton basalt
#

and again the goal is to make yellow fish shoot multiple times, if randFish can't do that then i can't use it

safe rover
#

Indeed, just wanted to report back on it :)

#

Wasn't sure what the behavior was called yesterday

wanton basalt
#

one more question - when i make an addon and define the addon targets, what exactly do i use? the target's mod in-game display name? the name of the mod folder? they don't really have an "internal" name i can use

safe rover
#

The mod folder name is the internal name right now, likely will need a change later down the line

wanton basalt
#

anyway im trying to get the fish to behave like this, but the script fires twice before the first time it turns, do you know why?

#

the (2, 15) should make it turn before it fires the 2nd shot, why not

#

this is closer to the behavior im looking for (i know the 3rd shot is useless right now i need to move it)

wanton basalt
#

i think this is closer to how it works?

#

i'm giving up on the custom fish idea until a modding update drops. it never seems to do what i want it to, unless i don't know what im doing

safe rover
#

I really don't blame you man, some of the old decisions that we carried over to Reclayed for backwards compatibility really should have stayed in the 2000s

wanton basalt
#

i still might not like this but ill see where it goes

safe rover
#

Spawned at different heights at perhaps even mirrored, those seem like they will have some great effect

wanton basalt
#

also using this trick where I do this to control how many shots they fire using the difficulty. you should also put in the modding reference that ifDifficultyIs behaves weirdly if there isn't a wait(): between every other command

safe rover
#

In what way does it behave weirdly? That sounds like a bug

wanton basalt
#

If i remove all of the wait(0); and play the game on expert, all fish fighters should fire 4 shots. Instead the fighters running script 11 fire 2 shots while the fish running scripts 12 or 13 behave as intended. Adding the wait commands fixed this for some reason

#

I also tried adding a starfish spawn in various locations to figure out which code block was running. No matter where i put it the starfish didn't spawn

safe rover
#

Interesting, that one requires some investigation for sure!

wanton basalt
#

ok i changed the difficulty to easy and it's running the hard scripts now. i have no idea what it's doing

#

looks like every difficulty below hard is running the hard scripts, but hard and above work as intended

#

seems like ifDifficultyIs is just really buggy

safe rover
#

Oh, with the addition of the new difficulty, everything has been moved up... Which annoyingly means that "difficulty": "Hard" is Expert ingame

wanton basalt
#

tbh i would rather have to clean up my mod again than have inconsistent naming

#

anyway i changed my script to this and now it seems to work as intended on all difficulties

#

so ifDifficultyIs seems to have been the problem

safe rover
#
"Easy" => Regular
"Medium" => Hard
"Hard" => Expert
"Nasty" => Nasty```
Send complaints to @buoyant lake
wanton basalt
#

@buoyant lake

#

it's early on in the game's modding scene so i'd be willing to make changes that break mods. better to do it now than after a bunch of good mods come out

safe rover
#

A possible solution to this mess is to make all the current difficulty commands obsolete and add a new range of commands that include the difficulty name in the command itself.
Of course that wouldn't help DiffDicts

wanton basalt
#

don't the current ones already do that? i don't understand

safe rover
#

As in, how do we adjust the difficulty names you use in these commands without breaking backwards compatibility

wanton basalt
#

i say just break backwards compatibility, there aren't many mods out yet so the damage dealt will be small

safe rover
#

Not my call to make, people will make angry comments when their game suddenly stops loading

safe rover
# wanton basalt also using this trick where I do this to control how many shots they fire using ...

Oh, think I see what is going on.
In this image, there are missing semicolons. I'd expect the game to toss errors your way. but it looks like it didn't..

I've tried following and nothing unexpected happened: (the print command is not in the current release build yet)```
ifDifficultyIs("difficulty": "VeryEasy", "places": 3);
print("message": "ifDifficultyIs: VeryEasy");
print("message": "buffer");
print("message": "buffer");
ifDifficultyIs("difficulty": "Easy", "places": 3);
print("message": "ifDifficultyIs: Easy");
print("message": "buffer");
print("message": "buffer");
ifDifficultyIs("difficulty": "Medium", "places": 3);
print("message": "ifDifficultyIs: Medium");
print("message": "buffer");
print("message": "buffer");
ifDifficultyIs("difficulty": "Hard", "places": 3);
print("message": "ifDifficultyIs: Hard");
print("message": "buffer");
print("message": "buffer");
ifDifficultyIs("difficulty": "Nasty", "places": 3);
print("message": "ifDifficultyIs: Nasty");
print("message": "buffer");
print("message": "buffer");

buoyant lake
buoyant lake
buoyant lake
#

Also note that in fact very easy is a legitimate description - you can actually just provide your own difficulty labels for the user which match. It's actually just our localised difficulty labels which are mismatching

#

I can add a "very easy" to the locale and get it localised if it helps too

wanton basalt
safe rover
#

Yeah, I do agree. It is part of the requirements for workshop too

buoyant lake
#

Copying @opaque island on this

opaque island
#

yep, we'll need to get to that. The folder names might be quite arbitrary in the end

wanton basalt
#

I've been putting my mod's version in the folder name cause I didn't know it breaks addons. I think it's fine if i keep doing that with the display name?

wanton basalt
#

also i dont know if this is a bug but it might be so i will report it - thrusterShips in the default levels have focusX and focusY defined, but the behavior doesn't seem to use it

#

changing the spawn location changes the X value it sits at, not the focusX

wanton basalt
#

also i would love a parameter for starfish, squids, thrusterships etc. to determine how long it stays on screen

buoyant lake
#

FYI Generally speaking we'll go through this thread after the next patch is done, though some bits may make it into this patch (partly to help the fan made P2 team). Patch 3 is about modding, dlc, and high score systems.

upper leaf
wanton basalt
#

Do you want me to post in the help and support channel about my concept for new fish fighter scripting

#

It might be a bit complicated, but the more you make possible, the better the mods will be, and the higher the chances the game stays alive for a long time

wanton basalt
cunning wind
#

Unrelated in this convo, but I would love to have a parameter that determines the X position for flip planes to trigger their flip behavior, instead of them just having a fixed X coordinate.

wanton basalt
#

not a bad idea. if we're also gonna softcode the flip plane idea more, i'd love to customize the turrets and choose the speed before/after it flips (imagine a flip plane that comes from the right side then slowly moves right)

#

or better yet, both that and a normal flip plane at once. what a wonderful day to be a tail gunner fan

#

also plz softcode the gunship behavior's explosion because according to Kroporo that is causing one of my custom enemies to use the wrong explosion sfx

#

Oh and somehow add a way to make custom train cars. I made one but the sprite I choose gets overridden so I have to either give it the appearance of an empty car or a transport car, and I picked the latter which also gives it a turret on expert/nasty

#

I went offtopic for a bit sry

pearl ether
pearl ether
#

Can we have entitiesphases.json?

frail matrix
#

any way to an enemy not leave the screen till death?

frail matrix
#

any entity behavior that just go totally straight?
like basic go straight

crimson linden
#

I guess you can make a fish fighter with a modified script

kindred bridge
#

One day we will have all of the enemy properties for all of the enemies and we will truly be complete

frail matrix
buoyant lake
#

Anthony and Kroporo are talking this week about if we can do some basic stuff here

compact ore
#

hello is this the right channel to ask about the update of a game?

buoyant lake
cunning wind
#

I'm not sure if anyone else have pointed out, but are there custom multi-star support?

#

Like being able to add custom star combos like pulse-lightning stars.

safe rover
#

Yeah, look into data/level_defaults.plat to see how they are set up

frozen glen
#

Is there a way to customize the bigplane (boss2) like adding more layer/body to make it longer or its hardcoded

frail matrix
#

Seems that i can only angle lightning with the laser star turret behaviour [it still switches], not sure if lightning can be angled with other
Or if can be used in other turrets behaviours because sometimes it just doesn't do it

frail matrix
#

messing with ligtnings, sadly the other lightning enemies proyectiles can't be change

hazy sage
#

Does anybody know how to use behaviours? Ive tried making an entirely new entity/ship and tried to use homingship as behaviours but it doesnt work

hazy sage
#

It just doesnt work, if there is already an entity using the same behaviour it just cancels eachother out

frail matrix
#

Homing ship is the missile one right?

frail matrix
#

aparently this thing is very sensitive to despawning

#

if you tried to spawn it too far to the right it will despawn

#

around x: 700 more or less should be the sweet spot

hazy sage
#

Alright cool thanks, ill give it a try later

safe rover
#

Will give it a 500 tick minimum lifetime before it despawns!
Good find @frail matrix!

hazy sage
frail matrix
#

🥳

hazy sage
#

now i just dont know how im gonna remove the rockets from shooting

frail matrix
#

sadly those seem to be done with the enemy behaviour itself

#

hmm wait

#

see the that you can put off set

#

maybe, if you were to put them very very offscreen
They should act as if they were not even there

hazy sage
#

i was thinking of the same thing, ill give it a try now

#

nope doesnt work

#

it still spawns where they ship is

pearl ether
hazy sage
#

definely

pearl ether
#

Cuz of the behaviour

frail matrix
#

i wonder if the offset were legacy code

cunning wind
#

It did say HomingShipReclayed

frail matrix
#

not sure if any weird entity layering could help for that

hazy sage
frail matrix
#

which behaviour is that?

hazy sage
#

pinkship

#

but i made them spawn behind the player but they hover at the end for a little before leaving'

frail matrix
#

i see

hazy sage
#

we need more specific behaviour stuff for modding but im sure they are already working on that !!

frail matrix
hazy sage
#

i hope so im pretty excited about it

frail matrix
#

me too ^^

crimson linden
#

I surely hope they separate movement behaviours from shooting behaviours

#

Y'know, being able to have a ship that moves like... for example, the homing ship, without having it forcefully fire missiles

hazy sage
#

Exactly what i wantt

hazy sage
#

Anyone know why back entities isnt working? I tried to replicate a backgreenun but replaced the sprite with something else and it doesnt work

frail matrix
#

Maybe attaching sprites via turrets might work

hazy sage
#

is it possible to add a bottom sprite to an entity that doesnt have the squid behaviour?

safe rover
#

Not at the moment, but with Lua it should become a thing with the next major update

hazy sage
#

i found out how but it was a weird workaround

pearl ether
hazy sage
#

Pretty much yea

#

I had the intention of them following thenplayer but with the way behaviours are with modding its hard to

frail matrix
#

are you able to make background entities?
i remenber trying but seem that it didn't spawn

crimson linden
#

Can't you simply treat them as BG tiles? It might be a good workaround

hazy sage
#

And that the behaviour is set to either greenun, redun, or the bigplane (serpent)

frail matrix
#

lua is here 🎉

pearl ether
#

coddin time

hazy sage
#

Oh god my brain,

frail matrix
#

this is the sprite handler,
for saucers the y acceleration is what determines the sprite

#

but i wonder how to make it work like other, like with hp

pearl ether
#

gave me a headache

#

I'll do this later

frail matrix
#

there a bit of a guide in types.lua

or more like a list of stuff you can do

#

in streaming assets is the file

pearl ether
#

ok then

hazy sage
#

Oh neat

#

Didnt kno they had any information regarding how to mod with lua

frail matrix
safe rover
#

the types file is for something called Lua Language Server, with it you get code completion

#

Not really meant to be read manually :)

frail matrix
#

i still read it

#

also do you know how to check the entity hp inside the lua?

pearl ether
safe rover
#

self.hitPoints

pearl ether
#

oh well

#

I'll touch lua later

#

gotta add halloween to REMAM

safe rover
#

The game uses this function for a lot of the damage visuals```lua
---@param hitPoints number
---@return integer
function BaseEntity.GetDamageFrame(hitPoints) end

#

There is no example for it in Lua land, but this is a common pattern for enemies like the big un in C# land:

int oldframe = frame;
frame = GetDamageFrame(hitPoints);
HandleDamageEffects(frame, oldframe);
Animator.GoTo(frame);```
pearl ether
#

ok got u

#

I'll make a new enemy on REMAM level 5

safe rover
#

👍

hazy sage
#

How i feel reading this thread knowing god knows all

safe rover
#

Keep in mind that, since this is a layer ontop of the existing systems, it is not super performant, but that shouldn't be an issue until one goes overboard with it :)

frail matrix
#

this one is funny clay_smile

frail matrix
safe rover
#

Intendend for pickups, but you know what they say.... with great power

frail matrix
#

actually this one will be useful for like a wall (hope the player doesn't get stuck in a loop of endless dead)

safe rover
#

I think they might, if you want to just bypass shields you can also use shieldPenetrating, that's a field for entities in entities.json

pearl ether
frail matrix
frail matrix
#

tried doing this, but seem that is just a nil value

#

i may be missing something, oh wait yes i am

#

still nil

safe rover
#

self.GetDamageFrame

crimson linden
#

I'm starting to understand some things 👀

frail matrix
#

hmm function doesn't call any overload

or so it says

frail matrix
#

i think the function is not returning properly

frail matrix
#

Im just gonna wait if there are more lua examples soon

safe rover
#

Did you also do self.hitPoints?

frail matrix
#

ouhm i will try

safe rover
#

self is the BaseEntity that you are currently in, would be nice to have these directly accessible but it is what it is

frail matrix
#

if i had a penny for everytime i needed help and only needed to add something very small i do have a ton of them

#

anyways this is everything on onTick()

safe rover
frail matrix
#

examples for making bullets and turret would be nice too in the future

safe rover
#

Something to consider, yes! I am not sure Lua entities have a way to get the player object at the moment now that I think about it. That'd be handy for custom bullets

frail matrix
proud talon
#

how do i guess where the framesize of enemies?

frail matrix
#

framesize?

proud talon
#

the grid of a spritesheet is what im referring

frail matrix
#

do you want the sprite sheet of enemies?

proud talon
#

ok explaining this might be hard but im talking about the gridsize of a spritesheet

frail matrix
#

ah

#

that really doesn't matter much

just remenber to make it have the same ammount of columns and files in animmation json and the spritesheet

proud talon
#

huh, neat

frail matrix
#

hmm i wonder how bullets are coded , and to translate it to lua

frail matrix
#

Would be nice to learn how to make bullets and make them target the player

Don't know if you can import info from the turret

safe rover
#

Bullets are pretty much the same as other enemies, except that they don't react to getting shot
I'm adding a GetPlayer(int index) method for lua to use, that way players can be targeted directly as well

#

When a turret spawns a bullet, it usually sets the initial "mx" and "my" (velocity, weird convention, I know) of the bullet through the command arguments

#

Also adding functions for setting the "logic layer":

  • SetLogicLayerDefault
  • SetLogicLayerTransparentFX
  • SetLogicLayerIgnoreRaycast
  • SetLogicLayerWater
  • SetLogicLayerUI
  • SetLogicLayerPlayer
  • SetLogicLayerPlayerShot
  • SetLogicLayerEnemy
  • SetLogicLayerEnemyShot
  • SetLogicLayerLoadScreen
  • SetLogicLayerPlayerPickupCollider
  • SetLogicLayerPickup
  • SetLogicLayerPlayerShotNoFruit

Those mostly covern how collision is handled, so that we don't have to check Enemies and Enemy's bullets every frame even if they would never interact

frail matrix
safe rover
#

Yes, if your entity is spawned by a supporting turret, those values you can get with self.commandArgs.GetFieldFloat("mx")

frail matrix
#
    mx = self.commandArgs.GetFieldFloat("mx")
    my = self.commandArgs.GetFieldFloat("my")
    self.movement = { x = mx, y = my, z = 0 }

it worked nicely

pearl ether
#

make the new update skins for specific levels @buoyant lake

buoyant lake
#

?

pearl ether
#

like your spooky platypus

#

and only on that specific level you can skins the enemies

#

on level.plat

buoyant lake
#

Not sure we can do that / if it's worth doing. @safe rover ?

safe rover
#

Entity definitions are global I'm afraid, it'd be quite an undertaking to make it level specific

#

But you are able to redefine them and append "level1" or "level2" to the entity name and make sure to only use those in the levels you want them in

pearl ether
#

Maybe good for the next patch

#

Put them on entity.json or just level.plat

safe rover
#

Rather big undertaking for something that is already possible, so I doubt it will be a priority

pearl ether
#

Ig it would better on the level.plat

pearl ether
#

Not level specific for this patch

safe rover
#

Yeah, but you can easily make a "saucer_level1" entity and use only that definition in level1

safe rover
#

level files currently have no ability to define entity definitions, and I don't really see that changing considering those definitions are baked in and parsed on startup

safe rover
# pearl ether Really?

Yeah, you can even send in "name" in the saucer command to change the entity it spawns without using spawnEntity directly (though I recommend you use spawnEntity instead)

pearl ether
#

{
"name": "saucer_level6halloween",
"sprite": "Sprites/Enemies/Halloween/saucer",
"behaviour": "Saucer",
"explosionEntity": "explosionSmall",
"explosionX": 0,
"explosionY": 0,
"sortOrder": 10000,
"maxHitPoints": 1,
"speed": 4,
"isEnemy": true,
"deathBulletEntity": "deathBullet",
"highlightPoints": false,
"points": 10,
"secondaryTargetValue": 1,
"customBehaviourData": {
"firePattern": {
"veryEasy": [ 80 ],
"easy": [ 80 ],
"normal": [ 60 ],
"hard": [ 40 ],
"nasty": [ 50 ]
}
}
},

safe rover
#

Make sure to actually spawn the saucer_level6halloween entity

#

if you spawn the saucer entity, you'll get the unmodified one

pearl ether
#

Oh.. so it needed spawn entitu

safe rover
#

You essentially created a new entity called "saucer_level6halloween" but are still spawning the entity called "saucer", so the level file needs to reflect it if you want to use the new entity. There is no way to do this without modifying the level

pearl ether
#

so spawnentity saucers?

#

do what now?

safe rover
#

Replaceing randSaucer would require spawnEntityRandom instead

pearl ether
#

Oh...

#

Yeah... needed spawnentity

#

I want to be specific level

safe rover
#

spawnEntityRandom("entity": "saucer_level6halloween"); would do the same as randSaucers("saucers": 1);, except that it will spawn your new entity instead of the saucer entity

pearl ether
#

Ok then

pearl ether
#

Make the mod tool allowed user to edit the current mod when?

#

So I don't need to make another workshop

safe rover
#

I believe it already can? I've personally never used it, so this is for @opaque island

opaque island
#

Which things do you want to mod? Anything in the mod itself should be possible. I'm going to update the tool so that it grabs the description etc from Steam so if you update it there your local version remains consistent

#

You can keep modifying your mod and reupload to workshop to update it without creating a new one. It uses the name parameter in the modmeta.json to link it to the existing workshop item

pearl ether
#

So just edit the modmeta?

opaque island
#

Just to say: If you place your mod folder inside the game's StreamingAssets folder e.g. SteamLibrary\steamapps\common\Platypus Reclayed\Platypus_Data\StreamingAssets\<your mod here> then the game will pick it up directly whilst you work on it

pearl ether
#

Ok

pearl ether
safe rover
#

Unlikely

crimson linden
#

Isn't there a way to trigger that yet? Like a Transformation Timer?
Or it can't be done within the same entity?

buoyant lake
frail matrix
#

any lua function for playing sfx?

#

also i notice my bullets are blocking the player shots

terse stump
#

I really want to know how do I make custom tank enemies or enemies that go only forward using lua.

buoyant lake
safe rover
#

PlaySound(audioName) is in the pipeline, can't say when it will be in a patch though

pearl ether
#

Go only forward?
Sounds like a normal greenun

terse stump
#

Oh, from right side of the screen where saucers and fish fighters spawn and it like starts shooting bullets like a squid gun or something

terse stump
#

Yeah, but it is like a secondary enemy instead of major

pearl ether
#

Ehhh not a problem

#

It just mayor and minor you get the enemy anyway

crimson linden
#

There was a field about Target / Primary value or something like that, in entities

#

Can't you change the target's priority by modifying that? 🤔

#

If not, I got no idea of what that is for

safe rover
#

That's exactly what that is for

cunning wind
#

The target value adds weight to the kill percentage.

#

For instance, one major enemy with the value of 10 is well, 10x more valuable than ten major enemies with the value of 1, duh.

safe rover
#

It goes the other way as well, a primaryTargetValue of 0 makes it not count as a major enemy at all (0 is the default value)

cunning wind
#

What happens if neither primaryTargetValue nor secondaryTargetValue are written in an entity's data? Will it be considered as a "non-enemy" by default?

safe rover
#

Yes, that's most of the entities

#

There is nothing special different about enemies and other entities

pearl ether
#

@safe rover "unlockKey": "none" what's that mean on skin.json

safe rover
#

That's not hooked up, this was initially there to allow skin rewards for doing certain things

safe rover
#

It's not hooked up, you can't use it

pearl ether
#

oh ok

crimson linden
#

The default player ship for Reclayed Classic is the Regular ship, right?

frail matrix
#

is it posible to add the homing bullet trail to an entity, atleast using lua?

safe rover
#

Oh, good question. I don't think so though

frail matrix
#

That trail looks very nice clay_smile
Also helps with bullet visibility

safe rover
#

It is also a rather special implementation, as it isn't clay sprite sheets

hazy sage
#

Is there a file that contains any example information on LUA for enemies?

#

Like id wanna know what the UN behaviour is like etc

frail matrix
hazy sage
#

Ye i did

frail matrix
hazy sage
#

Only example was the lua saucer

#

Oh

frail matrix
#

i can try to help you recreate an un if you want

hazy sage
#

Hmmm

#

Maybe tho.. rn im not on my pc

crimson linden
#

Honestly if more examples can be provided through time, it'd be quite useful!

#

At least for vanilla enemies and such

frail matrix
#

uns and squids seems pretty essential

also because of their components in them

crimson linden
#

True!

crimson linden
#

What does the Spawn Debug Entity command from -cheat mode do?
As in, where can I specify this Debug Entity, or where is it picked from?

safe rover
#

It's for debugging during development, not really for modders to use

crimson linden
#

ah gotcha, just wanted to make sure claythumbsUp

#

thanks for the answer, Kroporo !

crimson linden
#

Is it possible to add animations to a non-animated sprite, for example, the mineshard?
I'm trying but I can't make it work

safe rover
#

Generally the behaviour governs how a sprite is used, so not really, no

crimson linden
#

dang, that's a shame

#

thanks for letting me know anyways claythumbsUp
Hopefully this will be possible in the future, at least with lua or something 🙏

safe rover
#

With Lua it is very much possible, but that doesn't really help with existing behaviours

crimson linden
#

ah, I see... so I assume I'd have to recreate the entire entity with lua, creating my own new behaviour, right?

safe rover
#

Yes

crimson linden
#

Gotcha claythumbsUp
Well, I'll try my best to review and improve the little lua knowledge I have, then 🫡

#

.

By the way, may I suggest supporting custom water splashes per-level and other custom things like that in the future?
Maybe it could be a property similar to groundSprite and skySprite. It'd let you pick the name of the water sprite, and it'd automatically read the number suffixes that establish each layer and such.

It'd be useful to have one for little splashes and drips too, if possible 🥹

#

.

Thing is I'm trying to port Platypus 2, and there is a level with Water, and one with Lava. Sure, I could use Day/Night tint filters, but the effect isn't always ideal, and in this case I'm in Classic Mode where I prefer avoiding tint filters

safe rover
#

It would be nice to get a maintained wishlist going, that way Sillytuna has an overview on what the community would like

frail matrix
#

i notice, you need to manually write in the behaviour for hurt particles to appear?

#

also is there a function for leaving particles? or is it just spawn entity

safe rover
#

There is a function that updates the hurt particles defined in entities.json.
I believe it is self.HandleDamageEffects(currentDamageFrame, oldDamageFrame)

frail matrix
#

yeah that is what i have been trying with the damage phases
also tried using spawn but seem that i got it wrong

safe rover
#

Oh, I don't think that function is among the functions you define yourself, you're supposed to call it

frail matrix
#

ah right clay_smile

frail matrix
#

i suck at using get field

frail matrix
#

do i have to define everything here? only for damage particle

#

im giving up on this for a bit, to make other stuff

frail matrix
#

i was trying to do something like self.position.y = something
but seem that it didn't work , maybe was doing something wrong

#

seem that forcefully trying to assign the position with self.position doesn't work?

safe rover
#

Indeed, the position variable is overruled by the movement variable

frail matrix
#

i see

#

gotta find another way to make a floor for enemies then

frail matrix
#

the curve math still looks a bit unnatural

crimson linden
#

Woah that's pretty impressive!

frail matrix
#

i actually made some changes now
it should be better looking

crimson linden
#

May I recommend making the sprite appear crouching already, instead of making it "stop" in the middle of the screen?
Idk how to explain it but... basically not making it stop in the middle, since it looks a bit weird

frail matrix
#

i kinda did that to make it more visible to the player that they will jump

crimson linden
#

Maybe you could trigger the alert ‼️ thing (?

#

Not sure if it's possible...
But well, if you can't, your idea sounds good as it is tbh lol

frail matrix
#

that could get annoying if there a lot of them clay_spiral

but a basic sound could work too
but i don't think there a basic sound function yet

crimson linden
#

True 🥹
Yeah fair enough
Either way it's looking neat so keep up the good work 👍

pearl ether
#

how to make a saucer atatck from back?

#

then go back to front?

safe rover
# pearl ether how to make a saucer atatck from back?

I'd keep a boolean variable around to check if the x position is high enough, and if it is, invert x movement.
The way you do it now means that the condition for x < 100 is always going to be true (unless you spawn it midscreen)

Your self.position.x > -1000 check is also going to be true when you don't want it to at the moment

safe rover
#

It's quite a handful, but for the most part just defining count is going to be good enough

frail matrix
#

i see claythumbsUp

safe rover
#

It not being done for hurt particles in the main game doesn't stop you from using it differently in Lua of course!

frail matrix
#

i notice but, is laserSquidGun turret entity in the turret json?

#

oh wait is in entities, my bad

frail matrix
#

i wanted to replicate the lightning of squids, but im not sure if you can so the bullet is stick to the turret

frail matrix
frail matrix
safe rover
#

Yessir

frail matrix
#

yay, is that i didn't seen it in types lua

#

ah i found it

frail matrix
#

is even set as
"rows": 1,
"columns": 2

even the name is correct

crimson linden
#

Did you set "generate colliders" to true, in the entities file?

frail matrix
crimson linden
#

Huh... weird

frail matrix
#

i think is something with the collision map itself, as i collisioned with random thing

crimson linden
#

Maybe try making the collision more opaque, does that make sense?
Not sure if it'll make a difference tho

crimson linden
#

Hmm the collision seems to be cut in half, horizontally... I wonder what could be causing that

#

I wish there was a way to make collision sprites visible... I think it'd be useful for modders

frail matrix
#

yes that could be useful

#

unfortunately, the hitbox is still non responsive

#

maybe is the turret itself?

#

set the speed to 0 and still nothing

frail matrix
#

ouhgfkmn i give up for a bit,

crimson linden
#

what about the fire pattern?
what is 9999?

frail matrix
#

Shouldn't affect the collision

pearl ether
frail matrix
safe rover
#

I'd try to make a collision sprite that is a completely solid rectangle that does not touch the borders of the sprite

#

Could be that the collision generation is having trouble with the sprite

crimson linden
#

Yeah I was gonna say... it seems that the white collision part is exceeding the half of the spritesheet

#

Thus touching and even going past the sprite border

frail matrix
#

not the first time i had issues with collision, i was adding collisions to a regular enemy and for some reason the collision was non existent

#

this is the current collision

crimson linden
#

Still weird hmmm...

crimson linden
#

I wonder if your ship explodes at random locations of the beam, of if it's constant.

I also wonder if it's more of a timed issue, where the collision works correctly, but has some seconds of delay

frail matrix
crimson linden
#

Np! I'm also curious about those red errors on the left
You should check which .json / .plat they're from

#

I doubt it, but in case they affect sth here

frail matrix
#
local my
local mx

local timer = 120
local timer2 = 300
local timed = false
local spriteIndex

function OnInitialise()
    if self.commandArgs.HasField("speedY") then my = self.commandArgs.GetFieldFloat("speedY") else my = self.data.speed end
    if self.commandArgs.HasField("maxSpeedY") then myMax = self.commandArgs.GetFieldFloat("maxSpeedY") else myMax = self.data.speed * 1.25 end
    mx = self.commandArgs.GetFieldFloat("mx")
    my = self.commandArgs.GetFieldFloat("my")
    spriteIndex = 0
end

function OnTick()
    timer = timer - 1
    if timer <= 0 then
        timed = true
    end
    if timed == true then
        timer2 = timer2 - 1
        spriteIndex= 1
    end
    if timer2 <= 0 then
        self.Deactivate()
    end
    self.animator.AnimateTo(spriteIndex);
end


function HasCollision()
    return true
end

function ShouldKillPlayerOnTouch()
    return true
end

maybe is the lua code itself that is giving issues

frail matrix
crimson linden
#

Maybe you could experiment by changing some parts of the script
I'd assume it has sth to do with spriteIndex, but I'm not sure

frail matrix
#

is very simple

there a timer that every tick goes down by 1
if the timer get to 0
it activates timed
which activates a second timer
that when times, it kill the entity

the spriteindex changes between stages

#

spriteindex is just which sprite will be shown

#

now that i think, timed var is a bit useless

crimson linden
#

Doesn't it activate the 2nd timer tho?

frail matrix
#

yeah but i could just, make it so it activates when the timer goes to 0 instead of calling a new var

i think i did it like that because i was planning doing other thing with it

frail matrix
#

meanwhile i will try to know how to use
---@return Player
---@param index number
function GetPlayer(index) end

crimson linden
#

We have docummentation about all these, right?
Only thing I wish is we had more examples in the future
Those help (me) a lot

crimson linden
#

True :'>

frail matrix
#

so how does this thing actually work?

crimson linden
#

Try this sprite instead, @frail matrix
I did what Kroporo said, and made the collision box not touch the borders

#

I haven't tested it myself tho... but I think it's worth a try

frail matrix
#

Thank you ^^

I will try once there power in the house clay_spiral

crimson linden
#

np! :D
And dang :(
powerouts suck!!

frail matrix
#

Yup

safe rover
#

On Monday I can go take a closer look as well

frail matrix
crimson linden
#

yipee!! I'm glad :D

frail matrix
crimson linden
#

Np! Make sure that your columns / rows are divided exactly at the middle, and make sure to leave at least 2 pixels of space between the edges and the white collision sprite

crimson linden
pearl ether
frail matrix
#

i think it just fair, you can have it later if you want to make it faster

crimson linden
#

Do we have support for Galleries in mods? If we don't yet, i think it'd be a really nice addition for a future patch

#

I'd like to include concepts, fanarts and/or unused content there and such

frail matrix
#

my 2 current goals is

  • learn how to use function GetPlayer(index) end
  • and learn how to make a turret, or atleast an entity that shots proyectiles
crimson linden
#

ngl, the 2nd one would be quite useful!
As for the GetPlayer, well, depends on what it really does
it could be good for some advanced things, I assume

frail matrix
#

homing 👀

if you have the player coordinates, you can do a lot of fun stuff

#

kinda with the second wanted to replicate the mines behaviour of spewing bullets on dead

frail matrix
#

also does lua scripts can actually use print?

terse stump
#

I know how to use Lua scripting, but the only problem is that the custom enemies I made doesn't have any collision

frail matrix
terse stump
#

Yeah, here is like the code for it i guess
{
"sprite": "Sprites/Enemies/alien ufo",
"collisionSprite": "Sprites/Enemies/alien ufo_collision",
"generateColliders": true,
"collisionSpriteScale": 0.1,
"matDayCycleMultiplier": 0.5,
"rows": 1,
"columns": 1
},

safe rover
terse stump
safe rover
#

What does the collider look like?

terse stump
frail matrix
# terse stump

maybe you can shave some pixels of the edges

that may work

safe rover
#

That sprite looks like the game should should have no issues with it

#

The collision sprite does not have to be defined in animations.json, but it shouldn't make a difference even if it is

#

Can you try this just to see what happens?

terse stump
safe rover
#

Huh... Considering that they don't have any animations I believe they should be behaving consistently at least, you mind sharing the mod?

#

I'd try putting the collisionSpriteScale up as well, try 1.0 and 0.5

frail matrix
#

wanted to ask
how does function GetPlayer(index) end work?

can i asign it to a var like something = GetPlayer(index) ?

safe rover
#

Yeah, it returns a Player object I just noticed that the actual position isn't exposed though 💤
It is its own type, not a BaseEntity

#

Currently following methods are exposed on the player, gonna add position to this:

TriggerWarning()
Damage(penetrateShield)
GetWeaponTimer()
SetWeaponTimer(value)
ActivatePod()
RemovePod()
ClearPods()
ActivateDoubler()
DeactivateDoubler()```
frail matrix
#

i see. so position is currently not accessible?

safe rover
#

Yeah, sorry.. The idea of the method was so that the player position is accessible, but the returned object doesn't expose it like I thought

#

Looking into it now

#

Change is made and will add Player.GetPosition() and Player.GetWorldPosition() on the next patch

frail matrix
#

another question
i wanted to recreate the mine behaviours so
it would be on death
then spawn entity bullet with
function SpawnEntityLocal(entityName, localPosition, arguments) end

is the speed assign in arguments as mx and my right?

safe rover
#

Yes! Though I would use World positions to spawn them, as local positions are a bit more complicated due to the scrolling that happens vertically

frail matrix
#

so something like this?

SpawnEntityWorld(enemyshot_normal, self.worldPosition, { mx = 1, my = 1 })

safe rover
#

The first argument is a String, the name of the entity
And I don't think you can create an argument object like this. So you will need to create a variable via NewJSONObject() and then call AddFieldFloat("mx", 1.0) and AddFieldFloat("my", 1.0) on it

frail matrix
#

how do i get the diffculty from globals? im a bit lost

#

apologize if i ask too much

safe rover
#

Globals.difficulty should already be the value you want, no need to call get

#

-1 being easy difficulty

frail matrix
#

ah so is numbered

#

so if i had to guess
-1 = easy
0 = normal
1 = hard
2 = expert
3 = nasty

#

thank you ^^

safe rover
#

No worries

frail matrix
#

collisions will be the bane of my existance

frail matrix
#

been using this

but for some reason other lua behaviours enemies are doing the exact same behaviour

kinda the spawn death bullets thing is leaking onto other lua behaviours

all on, onKill()

#

maybe is "NewJSONObject()" giving issues

safe rover
#

What do you mean with leaking? Sounds like a bug

frail matrix
#

It means that other enemy with a lua behaviour is doing the exact same part of code but not having it

Let me get some footage later

safe rover
#

That sounds pretty bad I will need to take a closer look at that

frail matrix
safe rover
#

Oh boy

#

Can you dm me the mod? Something is not quite right, and that way it is easier to reproduce :)

#

You do have some errors in your level file, but that shouldn't cause these kinds of issues

frail matrix
safe rover
#

The OnKill issue is resolved! It affected a few other things including collision!
That all should become more consistent and predictable next patch

safe rover
frail matrix
#

that is a pretty small change

safe rover
#

Some of the collision issues you are having you'll need to wait for the patch

#

Of note is that you don't need to define a separate collision sprite unless you want to use a simplified one.

If generateColliders is true: The game uses sprite to generate your colliders if collisionSprite is missing

#

From experience the collision generation works best if you avoid holes, so I would fill out the donuts in your tick superbolt_collision.png

frail matrix
#

i see, so basically threat it as a polygon

safe rover
#

Yeah, simple is good! Being able to specify a separate sprite is so that we can fill out holes in sprites

frail matrix