#Custom Enemies Support/Thread
1 messages · Page 1 of 1 (latest)
Correct afaik but maybe we can add a way around that @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!
thats great to know, its just you cant give them new sprites or anything?
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
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
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
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.
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
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?
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
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?
That looks about right, yes.
- You will need to define "saucerhoming" separately
- The JSON parser is very very strict, so because there is a trailing comma all the way at the bottom, you will get errors
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
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
hahaha I didn't know that... this opens up more possibilities.
You just know somebody's going to try sticking a gun on the bonus text
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?
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
I thought that yellow tick was a new enemy first time playing lol, but then I figured it was something I mustve missed because of the difficulty I was playing on in level 5
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
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?
look for the spawnEntity command
there's a little bit of inconsistency with the commands derived from the original game script vs the newer, more sensible additions
a bit of rough work but they're working, even got another fella made
btw how does one move a custom stage to be after everything else 
oh did the video really corrupt? cmon
Played back for me, looks good
Works here and looks good
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
@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.
@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 🙂
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
@arctic ingot Can you add the support tag to this thread?
there 
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
Custom Enemies Support/Thread
what do the row and columns mean in there btw?
There is a SpawnEnemyEntitiesAtRandomCommand but it is only available through code, sounds like a simple addition!
peak
you can set their firing chance to 0%
or would that affect the turret also
is the fire chance the fire pattern?
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!
oh do certain enemies not normally fire unless set to have a fire chance?
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...
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
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
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?
@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
last enemy for the night, introducing the Trail Squid, probably also gonna make a small version too
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
I'm liking what you're doing here
Make a golden mother squid

F-27 Platypus spawning in and immediately blowing up at the end
retexture the yellow uns to make them look like thise annoying orange gunships (without turrets) from ii lol
Imagine squids that shoot huge bullets akin to the Squid Mother's secret weapon.
imagine that green trashcan that flings mines
or those bubble shooter squids
and the homing rocket 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.
yea good idea
In that sense, I would also personally refer to cannon boat as mortar boat.
what if we had a squid type that would like rush forward and liek explode in a aoe
i call them grenade squids
what is the mother squid's secret weapon?
Its exposed thruster gun.
it's hardcoded in behaviour
you can add them to saucers
@safe rover we could un hard code this?
un-hardcode, what exactly?
Squid weapon if hard coded
Sorry I don't follow, you mean to make boss 4, the squid mother less hardcoded?
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
enemyshot_accellerator is the name
IT'S u
enemyshot_huge_bullet is correct
Okay then. I was worried that both of us would be naive with these lately.
REAL
how to add them btw?
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
Anything can be a boss! Boss entities are not different from regular ones
just make them have a huge hp
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?
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
I guess the hacky solution would be to make an animation sheet with each frame the same
Sounds like the kind of game dev hack I approve of
wouldn't be the first time something like that happened
is there a difference between backGreenBigUn and greenBigUn?
I assume the back one, backs away instead of continuing to the right?
I forget these level files are more for than just enemies
the back ones are the ones that appear in the far distance; they have no effect on gameplay
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?
May have to break modding up into mod support and mod announce tomorrow. Got more posts than expected!
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?
Tomorrow then. I have a whole host of production tasks to do if I manage to sleep tonight....
No we can do that. I just need to consider organisation
yeah understandable, it can be a clutter adding too much 😵💫
I think two forums is fine for now. Main platypus channel still ok for chat. We'll see how busy it gets
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.
how does a level pause enemies from continuing to spawn? Usually happens when big enemies/minibosses are thrown around but mine just keeps trucking
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
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
Maybe the wait time is a bit too low? I can see its set to 1 but cant guarantee if that changes
for the waitfornoenemies?
I copied it from the existing levels, been building my level off level chunks from the main adventure and editing it
tbh waitforenemies is just an if function wether the enemies is still on the screen
I think I figured it out, I just put another after the boss so it holds everything after from spawning until theyre all dead
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 });
is there a reason to spawn a specific entity if you can just spawn them with spawnentity?
well useful for boss entities
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
oh so they will continously spawn without need for scripting
and when the enemy dies it will stop, what does the "places" do for it? I dont need to specify a thing?
how many things you wanna add
well I didnt really want to use this yet but knowing it for later would be good for a mid level boss
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)
places is how many it spawns in a batch?
Im confused now cause this would mean its spawning two octopus but this is referring to if the octopus is alive
so whats the places referring to
but it cant be spawning itself? is this a custom level youre showing?
if you want demo just copy the area 5 level 5 section
if you still curious
it's right there
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
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 });
you can really see how it works
is the places2 referring to the two lines of code
okay when you said it spawns itself that really lost me
wait( 100); spawnEntity("entity": "rocketsaucer", "y": 240, "x": 900);
wait( 50); spawnEntity("entity": "rocketsaucer", "y": 240, "x": 900);```
Oh also strange question but i wanna know the "wait( number )" ... what time does it use (like seconds or miliseoncs etc)
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
the specific entity spawns are a legacy from the original game; the original scripts were transferred directly across
didnt seem to work, the support didnt come
or it did but didnt loop
okay it is working its just not looping
Again it just if statement not loop statement
Ticks, at 60 ticks per second
Ohh okay great tysm
speedKillTimer = if you don't kill the boss in specifitime = he'll left
wonder how we will make enemies have new movement ai without dll modding
i wanna recreate those mini orange gunships without guns from ii
I think the only way to make new enemy ai is to edit the code itself
otherwise you need to use what there is
aight
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)
i bet my chances that we get a patch that makes enemy ai moddable yayayayaya 🤑
maybe in some simple way
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
Will we get the chance to make homing rockets from enemies seperate enemies
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
cool
Hell yeah
{
"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
Bullet entity being an actual enemy huh? That's definitely dope. And yes, keep up your good work!
Dpes anyone know the turret entity for this guy? I cannot find it for the life of me
hi ive got questions
How do you pull up the debug menu
run the game with cheats on
How do i enable cheats lo
O
if you're not playing on PC then idk
ty tho I never knew that 😭
also cheats mode on PC is bugged so that pressing F12 doesn't open the cheats menu even though its supposed to, so i have these saved
I just need something to tell me what went wrong especially when making custom enemies
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
hang on I changed nothing and it's working now what
is there a way i can change how fast the turret turns
Only for sub non Subship variants and Mother ship and Octopus bosses
Bigplane will result to this
It spawn on 0,0 coords
For bigplane (boss 2)
Could be use as a suprized attack afteer waitforenemies();
now thats what im talkin about
(nasty difficulty)
how do i make a custom enemy shoot lightning? can't get it to work
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
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
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
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
Can you make a brand new sprite that works like the train, though?
but isn't the train sprite per se, obviously
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 🙂
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
I think it needs to go off the train sprites because of the behavior
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);
Cant u sorta do that by making a new sprite and a collision png? Add a new animation that connects the two and use the train as a base for exactly that
Hol up i wanna make something like that when i can
you have to choose a carType for the train module and it overrides the sprite
Car =
0 emptyno mounts
1 empty with mounts
2 war (two legacy turrets)
3 cannon boat ver
4 Train head (Main boss)
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
@hazy sage
I don't think there is, or at least I never changed it... and if not this would be an excellent feature request
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
honestly a better way would be one of those things that hopefully @safe rover will have some time to add; sometimes we have to settle for good enough to get the game out. But the more people get into modding the more it's worth it for us to put more time into it as well
yeah, plus you have bigger priorities for now, i'm aware of that
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
Any chance for rotatable lightning turret support?
I think what I mean is the turret fires lightning while also rotating simultaneously, thereby sweeping across an area.
.... that's hardcoded
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
Not now ig
I've tried this as well as a goldfish that shoots lightning. I just tell it to shoot 'enemyZap' and instead of it doing something it just flashes blue and doesn't hurt the player
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
btw i also wanted to make this cause chicken invaders enemies have similar attacks
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
The error log must be screaming right now
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?
All pre-existing difficulties were simply renamed, thus pre-existing enemy scripts and behaviors are unchanged.
Of course.
oh so apparently the internal difficulty names are the same as the old ones, and the new difficulty is VeryEasy
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
did you redownload the mod starter pack
should look like this now
yeah I see it now
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.
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
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
Fair assumption to make!
"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
time constraints is a valid excuse
is it possible to customize enemy firing sfx?
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
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
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?
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
ah ok
for turret stats, what does fireTimer do? prevent it from shooting immediately after spawning?
It is different from behaviour to behaviour I'm afraid
do you happen to know what it does with SpinTurret behavior?
Not currently at the office, so I can't check right now
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
That works as well :)
i set it to 999999 and nothing changed so i have no idea what it does
Chances are it just doesn't use it at all too!
i think i believe that
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
i have no clue what im doing
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
it's crazy how similar to the old Platypus this is
if you set a null script for Fish Fighters, they behave exactly the same as here
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
maybe it triggers a loop or something... not sure hmm
aren't the scripts supposed to be in 'behaviours'?
i found them in level_defaults.plat
anyway i tried making a fish script that went something like [0, 10, 20, 30... 90] and they did this
oh, just checked, ur right!
my best assumption is that those numbers are basically locations that the fish fighter follows, probably relative to its starting position
Excluding "-1", which I assume just gives the instruction to loop the last movement
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
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
have you tried [ 0, 0, 0, ....... 0, 90, -1 ] ?
no
I thiiink it should go straight, and then down, I wonder
i'll test it now
I'm speaking blindly though lol
but let's see! hope it works
they instantly disappear again (like in the first video)
dang... let me think hmm
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
not what i was expecting
ending with -1 doesnt seem to make them not disappear, so idk why all of the default scripts do that then
dang, this seems more complicated than I thought
I can't figure it out either
I'll be doing some experiments too!
if it had an entry in the level data command reference that would be great
for sure :,)
I was toying around with the fishes yesterday too..I tought it would've been easier
Mine disappeared as well
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
@wanton basalt Sorry about the ping
at what location are you spawning the fighters? (x and y)
600, 300
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
- 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```
from what anthony has told me, (0, 0) is the top left corner and (900, 600) is the bottom right
Those little buggers are mental, the scripting format is taken from the old game
happy to see i can control when they fire bullets, because the whole reason i'm making yellow fish is that i want them to shoot multiple times. anyway i still have no idea how this works
again the behavior i want is randFish but with a custom sprite
I was attemtping randFish yesterday with the Platypus 2 green fish fighter as well
I think you can use sth like script 0 and 1
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
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
Don't think it does. For specifics you'll have to wait I'm afraid
It's fine I have other things I want todo
How to spawn them in a level tho? I copy pasted the fish in entities and animations and changed the sprite, I suppose I'm not writing the spawns correctly.
Should be doable with the spawnEntity command
I do this. unfortunately i don't know how to use the randFish script
I think you simply set a Minimum and Maximum X and Y coordinates for them to spawn on.
For example: MinY=0 and MaxY=300 should proably spawn them randomly in a range from the top to the middle of the screen.
I tried that and none spawned
wut
was the range not too far away?
also tried that it didnt work
I copied the range from a base level randFish
Hmm, lemme try, maybe there's something else to it
i heard them shooting but they were offscreen, i think they were just spawning at 0, 0 and using script 0
Probably yeah
huh it worked for me
OH yeah
you meant with custom sprites? Let me try that instead
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
Apparently, as Kroporo showed, the answer was right above our eyes
but it's still a bit tricky to understand
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 ]);
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
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
oh shoot, can confirm! the further away you put "-1", the later the fish disappears
for me adding 0s on the end doesn't make it dissapear later
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)
So, I assume that setting it to 0 skips to the next place super quickly. Something like that is said here, but I can't understand much
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
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
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
well if i do [1, 2, 3, 4, 5... 20] it goes in a circle then disappears
60 frames you mean
60 ticks, yes
setFighterScript("scriptIndex": 11, "script": [ 1, 60, 100, 60, 100, 0, 60, 100, 60, 100, 60, 0, 0, 0, -1 ]);
try setting the 4th value to 999
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
hmm, okay so there's something I still need to investigate about the "100"
that's the thing, I think there's a general order, but I'm not sure about numbers like "100" or anything above it
the most bizzare thing is that if i make the first 7 entries the same as script 0, it doesn't behave the same
yeah honestly that's bugging me a bit too.. I wonder if it has to do with location
omfg you have to do setFishFire("enabled": true); for them to fire at all
still no idea as to why they disappear early
This is what I've decoded so far...
not sure if it's right or wrong, but I think I'm getting somewhere
oh LOL
Yeah I think I had that on my script already, that's why it worked for me
also playing on a harder difficulty, since there's a bit of randomness (or set all firing chances to "100")
if i do setFighterScript("scriptIndex": 11, "script": [ 1, 0, 100, 60, -1 ]); it instantly fires then instantly despawns
Try changing "60" to a higher number
I'll do the same
i think scripted fish fighters dont RNG fire
didn't do anything
oh, really?
lemme check, I didn't know this
oh shoot, you're right!
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 ]);
try putting "80" after "5"
I think it'll wait 80 ticks before disappearing, after turning up
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
oh crap I think I finally get it, hopefully I got your back, buddy!
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
It still takes the same time to disappear?
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
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
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
because you're shooting from the 4th direction, where it's almost gone vertical, I think
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
My logic is that it works the same as legacy Platypus, since they said it was based on that old script
and welp, old Platypus' fish fighter has less frames
well do you know how that works?
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
so then what angle is 17?
I assume it cycles through them, but I'm gonna test it 👍
either that or it disappears lol
we'll see
it seems like the 2nd entry is also always skipped
it disappears
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
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
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.
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
I honestly think either 2 or 3 instructions after the number "100" are skipped
it's weird
setFighterScript("scriptIndex": 11, "script": [ 1, 0, 1, 15, 999999, 15, 100, 0, 3, 15, 4, 15, 100, 0, 5, 15, 6, 15, -1 ]);
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
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
One last question though, since I didn't fully understand.
You want it to fire when it's looking upwards, or when, exactly?
For the second shot, I mean
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
gotcha 👍
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.
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
yeah, exactly 😭
and no worries, I believe your frame numbers are accurate
when you have time I need a clearer explanation of how this works
I'm going to bed for now
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.
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
Fire timer is indeed for the firstShotDelay, but this value is only read from the level commands, not from entities.json data. If not provided this value is 0
If you want to recolor a "randFish", then you need to use the "RandomFishFighter" behavior instead, it doesn't use the fighter scripts
what do you mean? my yellow fish behave identical to black fish running the same script
and again the goal is to make yellow fish shoot multiple times, if randFish can't do that then i can't use it
Indeed, just wanted to report back on it :)
Wasn't sure what the behavior was called yesterday
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
The mod folder name is the internal name right now, likely will need a change later down the line
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)
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
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
ok this might be my "workaround"
i still might not like this but ill see where it goes
Spawned at different heights at perhaps even mirrored, those seem like they will have some great effect
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
In what way does it behave weirdly? That sounds like a bug
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
Interesting, that one requires some investigation for sure!
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
Oh, with the addition of the new difficulty, everything has been moved up... Which annoyingly means that "difficulty": "Hard" is Expert ingame
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
"Easy" => Regular
"Medium" => Hard
"Hard" => Expert
"Nasty" => Nasty```
Send complaints to @buoyant lake
@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
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
don't the current ones already do that? i don't understand
As in, how do we adjust the difficulty names you use in these commands without breaking backwards compatibility
i say just break backwards compatibility, there aren't many mods out yet so the damage dealt will be small
Not my call to make, people will make angry comments when their game suddenly stops loading
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");
Send complaints to [email protected] (yeah this one was a bugger but it is what it is!)
What if we added a second set of defs which are named more sensibly but retain the old ones for backwards compatibility? e.g. Easy_Difficulty, Easy_Mod, Dif_Easy...?
It raises other risks for us as well - it's not something we'd want to do lightly.
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
btw just want to say this DEFINITELY needs to change, or at the very least, say somewhere in the modding guide that changing a mod folder's name will break addons, because i've been doing that thinking it didn't matter. Easiest fix imo is just put a parameter for internalName in modmeta.json
Yeah, I do agree. It is part of the requirements for workshop too
Copying @opaque island on this
yep, we'll need to get to that. The folder names might be quite arbitrary in the end
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?
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
also i would love a parameter for starfish, squids, thrusterships etc. to determine how long it stays on screen
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.
Yeee
Oh you saw this... I suggested we add a new fish fighter 2 behaviour that can be controlled more sensibly and just leave the legacy one for legacy scripts. The fact that you can't even steer them with the precision of their own sprite set is sad.
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
this point still stands btw. i've mostly figured out how legacy fighter scripts work but there are still some things about my own scripts that i dont understand. there are duplicate entries at the end of the list because for some reason if i dont do that it despawns early
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.
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
Maketrain() : yeah keep going pal
Keep it all here 🙂
Can we have entitiesphases.json?
any way to an enemy not leave the screen till death?
any entity behavior that just go totally straight?
like basic go straight
I guess you can make a fish fighter with a modified script
One day we will have all of the enemy properties for all of the enemies and we will truly be complete
custom enemy behaviours would be nice
Anthony and Kroporo are talking this week about if we can do some basic stuff here
hello is this the right channel to ask about the update of a game?
You can start a thread in #1417954310536429669 or just post in #🚀┃platypus-discussion if a general comment or query
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.
Yeah, look into data/level_defaults.plat to see how they are set up
Is there a way to customize the bigplane (boss2) like adding more layer/body to make it longer or its hardcoded
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
messing with ligtnings, sadly the other lightning enemies proyectiles can't be change
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
What is it exactly doing?
It just doesnt work, if there is already an entity using the same behaviour it just cancels eachother out
Homing ship is the missile one right?
2 homing ship behaviours working (modified clone to have un sprite)
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
Alright cool thanks, ill give it a try later
Will give it a 500 tick minimum lifetime before it despawns!
Good find @frail matrix!
it works!
🥳
now i just dont know how im gonna remove the rockets from shooting
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
i was thinking of the same thing, ill give it a try now
nope doesnt work
it still spawns where they ship is
Hardcoded
definely
Cuz of the behaviour
i wonder if the offset were legacy code
It did say HomingShipReclayed
not sure if any weird entity layering could help for that
this is pretty cool
which behaviour is that?
pinkship
but i made them spawn behind the player but they hover at the end for a little before leaving'
i see
they can spawn pretty far back thats good, i made them spawn X -200
we need more specific behaviour stuff for modding but im sure they are already working on that !!
yeah !,
im sure patch 2 will be good for this
i hope so im pretty excited about it
me too ^^
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
Exactly what i wantt
Anyone know why back entities isnt working? I tried to replicate a backgreenun but replaced the sprite with something else and it doesnt work
I think those might be tied to some behaviors
Am not sure.
Maybe attaching sprites via turrets might work
is it possible to add a bottom sprite to an entity that doesnt have the squid behaviour?
Not at the moment, but with Lua it should become a thing with the next major update
Pretty much yea
I had the intention of them following thenplayer but with the way behaviours are with modding its hard to
are you able to make background entities?
i remenber trying but seem that it didn't spawn
Can't you simply treat them as BG tiles? It might be a good workaround
Im very late on this response but u can! U just have to set them to a different layer in the animation file
And that the behaviour is set to either greenun, redun, or the bigplane (serpent)
lua is here 🎉
coddin time
Oh god my brain,
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
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
ok then
the types file is for something called Lua Language Server, with it you get code completion
Not really meant to be read manually :)
check entities.json
self.hitPoints
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);```
👍
How i feel reading this thread knowing god knows all
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 :)
this one is funny 
how it feels, reading not knowing lua
Intendend for pickups, but you know what they say.... with great power
actually this one will be useful for like a wall (hope the player doesn't get stuck in a loop of endless dead)
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
only if u know the codes
breaking my mind trying to learn how to use this
tried doing this, but seem that is just a nil value
i may be missing something, oh wait yes i am
still nil
self.GetDamageFrame
I'm starting to understand some things 👀
hmm function doesn't call any overload
or so it says
i think the function is not returning properly
Im just gonna wait if there are more lua examples soon
Did you also do self.hitPoints?
ouhm i will try
self is the BaseEntity that you are currently in, would be nice to have these directly accessible but it is what it is
YES
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()
Sums up programming pretty well
examples for making bullets and turret would be nice too in the future
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
It can be useful for enemy entities too, like homing missiles or any homing thing
how do i guess where the framesize of enemies?
framesize?
the grid of a spritesheet is what im referring
do you want the sprite sheet of enemies?
ok explaining this might be hard but im talking about the gridsize of a spritesheet
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
huh, neat
hmm i wonder how bullets are coded , and to translate it to lua
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
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":
SetLogicLayerDefaultSetLogicLayerTransparentFXSetLogicLayerIgnoreRaycastSetLogicLayerWaterSetLogicLayerUISetLogicLayerPlayerSetLogicLayerPlayerShotSetLogicLayerEnemySetLogicLayerEnemyShotSetLogicLayerLoadScreenSetLogicLayerPlayerPickupColliderSetLogicLayerPickupSetLogicLayerPlayerShotNoFruit
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
is it currently posible to do that in lua?
Yes, if your entity is spawned by a supporting turret, those values you can get with self.commandArgs.GetFieldFloat("mx")
mx = self.commandArgs.GetFieldFloat("mx")
my = self.commandArgs.GetFieldFloat("my")
self.movement = { x = mx, y = my, z = 0 }
it worked nicely
make the new update skins for specific levels @buoyant lake
?
like your spooky platypus
and only on that specific level you can skins the enemies
on level.plat
Not sure we can do that / if it's worth doing. @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
Rather big undertaking for something that is already possible, so I doubt it will be a priority
Ig it would better on the level.plat
Which mean if I reskin the saucer it will be all saucers in all levels
Not level specific for this patch
Yeah, but you can easily make a "saucer_level1" entity and use only that definition in level1
Really?
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
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)
nope
{
"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 ]
}
}
},
Make sure to actually spawn the saucer_level6halloween entity
if you spawn the saucer entity, you'll get the unmodified one
Oh.. so it needed spawn entitu
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
Replaceing randSaucer would require spawnEntityRandom instead
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
Ok then
Make the mod tool allowed user to edit the current mod when?
So I don't need to make another workshop
I believe it already can? I've personally never used it, so this is for @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
So just edit the modmeta?
I'll wait for this update ig
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
Ok
Can we have EntitySwap func on the next patch?
Unlikely
Isn't there a way to trigger that yet? Like a Transformation Timer?
Or it can't be done within the same entity?
I don't think this is one we can do as it's not really needed and can be hacked around as kroporo says. Apologies.
any lua function for playing sfx?
also i notice my bullets are blocking the player shots
I really want to know how do I make custom tank enemies or enemies that go only forward using lua.
May be a nice one @safe rover
PlaySound(audioName) is in the pipeline, can't say when it will be in a patch though
Real
Zipper?
Go only forward?
Sounds like a normal greenun
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
Homming ship + squid turret
Yeah, but it is like a secondary enemy instead of major
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
That's exactly what that is for
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.
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)
What happens if neither primaryTargetValue nor secondaryTargetValue are written in an entity's data? Will it be considered as a "non-enemy" by default?
Yes, that's most of the entities
There is nothing special different about enemies and other entities
@safe rover "unlockKey": "none" what's that mean on skin.json
That's not hooked up, this was initially there to allow skin rewards for doing certain things
how to use it?
It's not hooked up, you can't use it
oh ok
The default player ship for Reclayed Classic is the Regular ship, right?
is it posible to add the homing bullet trail to an entity, atleast using lua?
Oh, good question. I don't think so though
That trail looks very nice 
Also helps with bullet visibility
It is also a rather special implementation, as it isn't clay sprite sheets
Is there a file that contains any example information on LUA for enemies?
Like id wanna know what the UN behaviour is like etc
have you downloaded the workshop tool and downloaded the new mod starter pack?
Ye i did
there currently only the saucer as an example
i can try to help you recreate an un if you want
Honestly if more examples can be provided through time, it'd be quite useful!
At least for vanilla enemies and such
uns and squids seems pretty essential
also because of their components in them
True!
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?
It's for debugging during development, not really for modders to use
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
Generally the behaviour governs how a sprite is used, so not really, no
dang, that's a shame
thanks for letting me know anyways 
Hopefully this will be possible in the future, at least with lua or something 🙏
With Lua it is very much possible, but that doesn't really help with existing behaviours
ah, I see... so I assume I'd have to recreate the entire entity with lua, creating my own new behaviour, right?
Yes
Gotcha 
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
It would be nice to get a maintained wishlist going, that way Sillytuna has an overview on what the community would like
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
There is a function that updates the hurt particles defined in entities.json.
I believe it is self.HandleDamageEffects(currentDamageFrame, oldDamageFrame)
yeah that is what i have been trying with the damage phases
also tried using spawn but seem that i got it wrong
Oh, I don't think that function is among the functions you define yourself, you're supposed to call it
ah right 
i suck at using get field
do i have to define everything here? only for damage particle
im giving up on this for a bit, to make other stuff
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?
Indeed, the position variable is overruled by the movement variable
Woah that's pretty impressive!
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
i kinda did that to make it more visible to the player that they will jump
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
that could get annoying if there a lot of them 
but a basic sound could work too
but i don't think there a basic sound function yet
True 🥹
Yeah fair enough
Either way it's looking neat so keep up the good work 👍
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
Adding two utility functions for a common pattern. This is only done for the actual death particles (not the hurt particles when the frame changes)
But I'm sure it'll come in handy
It's quite a handful, but for the most part just defining count is going to be good enough
i see 
It not being done for hurt particles in the main game doesn't stop you from using it differently in Lua of course!
i notice but, is laserSquidGun turret entity in the turret json?
oh wait is in entities, my bad
i wanted to replicate the lightning of squids, but im not sure if you can so the bullet is stick to the turret
Going onto this, is basically a x and y are the same as the turret, so the is glued to the turret itself like lightnings
is this avaluable in the newest patch?
Yessir
why is my bullet collision not working properly
is even set as
"rows": 1,
"columns": 2
even the name is correct
Did you set "generate colliders" to true, in the entities file?
yeah
Huh... weird
i think is something with the collision map itself, as i collisioned with random thing
Maybe try making the collision more opaque, does that make sense?
Not sure if it'll make a difference tho
Hmmm
Could be!
I'm also not sure if collision map should have a very specific color, like pure white and such
Could be the case here maybe
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
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
ouhgfkmn i give up for a bit,
what about the fire pattern?
what is 9999?
That is so it attack once and never again
Shouldn't affect the collision
Remove the collision
erm, my idea is make an indicator
removing the collision would make it do damage with the indicator
so no.
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
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
hmmm
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
Still weird hmmm...
I'll analyze this when I'm home
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
thank you
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
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
ah those, they are from the level itself, really they are nothing
My brain melts a bit with these, but maybe someone like Kroporo could help 🥹
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
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
Doesn't it activate the 2nd timer tho?
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
meanwhile i will try to know how to use
---@return Player
---@param index number
function GetPlayer(index) end
We have docummentation about all these, right?
Only thing I wish is we had more examples in the future
Those help (me) a lot
i think that is all we have
True :'>
so how does this thing actually work?
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
Thank you ^^
I will try once there power in the house 
np! :D
And dang :(
powerouts suck!!
Yup
On Monday I can go take a closer look as well
oh my it worked
thank you so much ^^ 🩷
yipee!! I'm glad :D
oh yeah i made a video of it working
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
ooooo neat 👀
i see
The charge is too slow
i think it just fair, you can have it later if you want to make it faster
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
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
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
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
also does lua scripts can actually use print?
I know how to use Lua scripting, but the only problem is that the custom enemies I made doesn't have any collision
did you set the collision sprite properly?
or have one?
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
},
Make sure you let the lua behaviour know it should be colliding and also that they should kill the player:
return true
end
function ShouldKillPlayerOnTouch()
return true
end
It has those already, but for some reason, collisions became nonexistent, temporarily
What does the collider look like?
maybe you can shave some pixels of the edges
that may work
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?
Tried it out, the first few doesn't have any collision, but some manage to have any
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
wanted to ask
how does function GetPlayer(index) end work?
can i asign it to a var like something = GetPlayer(index) ?
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()```
i see. so position is currently not accessible?
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
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?
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
so something like this?
SpawnEntityWorld(enemyshot_normal, self.worldPosition, { mx = 1, my = 1 })
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
Globals.difficulty should already be the value you want, no need to call get
-1 being easy difficulty
ah so is numbered
so if i had to guess
-1 = easy
0 = normal
1 = hard
2 = expert
3 = nasty
thank you ^^
No worries
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
What do you mean with leaking? Sounds like a bug
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
That sounds pretty bad I will need to take a closer look at that
only the green un
and the mini skull mines have said code
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
those has been since the beginning 
anyways yeah give me 1 second
The OnKill issue is resolved! It affected a few other things including collision!
That all should become more consistent and predictable next patch
Believe you need to use args.AddFieldFloat and not args:AddFieldFloat
that is a pretty small change
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
i see, so basically threat it as a polygon
Yeah, simple is good! Being able to specify a separate sprite is so that we can fill out holes in sprites
i tried and seem that is still giving some issues
like some enemies still do it, sometimes?
is a bit more inconsistent now