Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Maybe a bit of a weirdly specific question, but I was thinking of pokemon like Spinda, where their markings are essentially randomly placed. Usually I would do this with a clipping mask and a random x and y coordinate when drawing the sprite, but I was curious if you knew off the top of your head if this would work? I would probably need to add the X and Y variable to the individual monster, and use that?

I think the easiest way to do things like this would be to expand global.monster_data and add a "draw script" field. Whenever the monster is drawn, invoke this script instead of just draw_sprite/draw_sprite_ext (you can find all cases where a monster is drawn by doing a project-wide search for the "mond_SPRITE_BATTLE" constant). For monsters that don't need any special drawing, you'd add a default script that just draws the sprite like normal.

This is gonna be a bit tricky since a lot of the drawing is in menus (shrine terminals, status screen etc) so you'd probably need to add a new type of GGUI element that contains both a sprite and a script to draw it with (right now monsters are drawn in menus by creating a sprite element containing their sprite).

For the random markings themselves, the easiest way would be to use random_set_seed() and construct the seed from something that's unique to the monster and won't change - e.g. some sort of hash of their IVs (or you could give them a new "ID number" field set to like, irandom(9999999) when generated with amp_generate_monster() if you think that's easier), then generate the random coordinates to draw with, and finally randomize() to reset the RNG again. This way, the random numbers will always be the same for the monster, but you don't need to store them in any way.

Thanks so much for all your super in depth answers, it's always helpful!

Curious because I couldn't see any built in function for it, what would be the easiest way to change text speed temporarily? To give the effect of someone speaking slowly, for instance.

Secondly, I don't see an easy way to do this in your code anywhere, so I was curious about "gift" monsters. I.E. an event that just straight-up gives one specific monster upon talking to someone.

Thanks again so much for your responses.

(1 edit)

Gift monster ID's easier, so let's start with that.

Try amp_get_new_party_id to get the ID of the first empty slot in the party. If NONE, there's no empty slot - either abandon the gift procedure and tell the player they need to make some room in the party, or amp_get_new_box_id to get the first empty slot in the storage system instead. When you've got an empty slot, use amp_generate_monster to actually create a monster. (And optionally, give it a held item, special moves and so on - check out all the fun stuff in Scripts --> Data Mangling --> Active Monster Party). Also call msh_recompute_seencaught, in case the player didn't have this monster dex-ed yet.

(You can see an example of this stuff in action if you check mev_intro_starterselect_confirm.)


Now for text speed: There's two places where text speed is used, both in the message_handle script.

Line 17:

for(var c = 0; c < 2 + 2*k_a; c++){ //(main speed control - this many letters are typed per game step)

and line 23:

message_cooldown += 10; //(temporary pause on detecting the "|" character)


Depending on what needs you have, you could change either of those to put in some more speed control. I.e. instead of typing 2 + 2*k_a letters per step, you could type global.text_speed*(1 + k_a) letters, where the text speed variable defaults to 2 but there's a new "cc_textspeed" cutscene command script (see Scripts --> Cutscene System --> Cutscene Commands) which lets you change it at will. (I.e. change it to 1 to type more slowly, or change it to 99999 to reveal text instantly (but | characters can still be used to add dramatic breaks))

And of course, if you just want to add dramatic breaks or show someone enunciating a word extra clearly, there's no need for extra code - you could just sprinkle in some |s - one between each letter |l|i|k|e| |t|h|i|s, or a bunch at once when someone's...||| catching their breath.

(+1)

Ahhhh thank you! Somehow I COMPLETELY missed the AMP scripts in data mangling, so I was just going around in circles for a few hours.