Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hi Yal! Great job with this engine.  Love the battle engine! i had a Q.  How can i equip the Player with all the available Monsters in his party at the start of the game? 

Easiest way would probably be to edit cis_intro_part2 and swap out the cc_intro_startermonsterselect / nickname logic; rather than making a monster choice menu and wait for your input, the startermonsterselect script would instead fill your party with the monsters you want:

var amp = amp_get_new_party_id();
amp_generate_monster(amp,monster_id,level)

First get the ID of the first empty slot in the party, then generate a monster there using its species and level, repeat as many times as you want. There's matching get-first-free-slot functions for the boxes and the temporary enemy slots, too.

To go through every monster like this, rather than hardcoding the monster_id you could loop from 0 to MONSTER_MAX.

Also note that if you really want the player to have every monster in the party, you probably want to increase PARTYSIZE_ACTIVE from 6.

(1 edit)

Amazing!!! i love this engine so much.  Also i tried to add a Monster.  I tried to just input the code in init_monsters but do i need to also add the the "monster_WRAITHMANITA" somewhere else?  What is the best way to add a monster.  if you put this tutorial somewhere let me know thank you for your quick response and everything!

NM I FOUND IT IN CONSTANTS where to put the Macro!

(1 edit)

If you haven't found it yet, try middle-clicking constant / function names to immediately open the script file where they're created. Super useful when navigating a large project. (So in this case, you could've clicked any of the monster_ constants to go to the file where they're defined, and that'd been the place to add new ones)

Also the ctrl-shift-F and ctrl-P hotkeys for opening global search / jump-to-asset can be useful if you know something's name but can't find it.

great short cut thank you!

Also it worked! thank you! one last thing. How i can I code so Player can run away from Trainers? 

The menu event script for this is mev_battle_escape, you'd just need to remove the special case for trainer battles.

Though you might need to take further measures to prevent the player from immediately ending up in a rematch, cc_battlestart_trainer saves the player's position after they've entered the trainer's vision range. So you'd either need to keep track of a previous position somewhere so you can deposit the player out of harm's way, or maybe give the player a temporary invincibility to further battles after they get away (and while this countdown is ongoing obj_npc_trainer's User Event 2 code - which is where they look for players - will ignore them)

Ok thank you I shall attempt this!

what would be the best way to just remove the trainer from forcing me into a battle.  I don't need that functionality in the game i'm building  The player would initiate the battle by walking up and pressing the action button.

(+1)

NM i figured it out!  I think i am good to go for now!!! time to start building!~

Hi Yal! me again.. I've gotten things going and I'm almost there where this works but now I can't seem to figure out how to add a room in the indoors room.  There is no code in the door object and i can't find the script that gives x and y coordinates for the indoors room.  The purely script based engine is very hard to get used to. I'm used to engines with more object based code than scripting.    I also added another tile set for the indoors and the engine crushed it.  Is the room getting resized upon output?

I completely broke the game adding a room.  I deleted it and now player spawns in the middle of the ocean :( Please help.

If you turn on the DEBUG_MODE flag you'll get some helpful printouts in the "Output" window when you load a room (check out the player's Create Event + Alarm 1 event for the code that handles where to spawn).

I think what's happening here is, you saved the game in the now-deleted room, and then when the room doesn't exist anymore the fallback code in mev_title_continue_fileselected which spawns you in the lab might not work anymore if you've changed the layout. (Or if you re-created a room with the same name but a different layout, the saved position will be used but now be in the middle of the ocean)

The door code is in obj_player's collision event with obj_door. But they're meant to be usable without adding any code, instead open the instance in the room editor and check its "variables" window:

Here you select which room to go to and a "label" (whatever text you want), the player is automatically placed at the door object with the same label as the one they entered from. So you can label doors in a town based on which character's house they lead to, and so on. (The code that loads the player based on which door they used is in obj_player's Alarm 1 event)


Not sure why the tileset is so distorted but my theory is that it might've gotten broken if it's got a different size from the existing ones? (320 x 256). Height shouldn't matter but the 320 pixel width is since the tile indices are used for collision checking (left 160px (= 10 tiles) are walkable tiles, right 160px are walls).

Also make sure the tileset settings are correct!

These should also match the grid size of the tile layer you're placing these on (A), re-selecting which tileset to use on the layer (B) will refresh how the tile layer is drawn as well.


Thank you. I figured out your label system early on.  I tried to make a room in the indoor and made a door and added a new label.  The player would touch the door in overworld and respawn back in the overworld.  I didn't know what to do. the  next thing i did was use the label of one of the already existing locations in "indoors" and altered the labels of one of the other pre existing indoors.  this caused a strange confusion to occur and the tiles were crushed.  I then decided perhaps it would be best to make a new room.  I copied the room to ensire if there were any game code it would remain intact but upon doing so i destroyed the game.  I deleted the room and then repawned in the ocean.    I just checked the settings on the tiles and they are correct and also correct in the room.  As you are correct the code must be sending me to the ocean of a room that doens't exist however, it has the same sound as the forrest so i think that's where its sending me.  How can i fix?  I may also try adding the tiles in want to the pre existing tile set provided to see if that works.

i just checked the create event and alarm 1 of the player. I have no idea how to fix.  

What I was thinking was, you'd enable DEBUG_MODE (line 5 of init_constants is "#macro DEBUG_MODE false", change it to "#macro DEBUG_MODE true") and then you'll get messages telling you what happens. E.g. if a door transition takes priority, the game will print "Came through a door, jump to LABEL" (so if you're not where you think you are, you can check that the label is correct) and it'll tell you "Player loaded! (room=NAME OF ROOM)" as well so you can tell where you ended up.

You could try adding additional show_debug_message's to e.g. print the player's position after loading, that should make it easier to find in the room editor:

show_debug_message(tsprintf("Player location: %, %",x,y))


As I said before, going through a door will place you at the door with the same name in the other room. So a drawback of this approach is that you can't link two doors in the same room together (because when looping over the door objects it'll find whichever of the two doors with that label is first in the instance list and always pick that). If you want to warp between places in the same room I'd probably create two new objects, "obj_teleport_entrance" and "obj_teleport_exit", which has a label the same way the doors have. Then in player's collision with teleport_entrance, run this code:

var target_label = other.label;
with(obj_teleport_exit){
  if(label == target_label){
     other.x = x;
     other.y = y;
     break;
  }
}

Now each teleport pair would use one entrance and one exit. If you want a teleport to be in both directions you'd have entrance A and exit B on one side and entrance B and exit A on the other side; make sure to place the exit some distance away from the entrance (otherwise the player gets stuck in an infinite loop of warping between them).

output window says this: 

Player loaded! (room=rm_driftwoodforest)

Interactible set up with script 100525

Read autoflag rm_driftwoodforest:2208:1088, has value undefined

Interactible set up with script 100525

I never made a code saying to go there so i don't know whats going on or how to fix.

Is this from loading a previously saved file or when creating a new file?

mev_title_continue_fileselected has some fallback code if the load fails which warps you to a specific spot (indoors area with coordinates set to the center of the lab), cc_intro_startgame is what sets your initial position from a new savefile - this is the same coordinates as the fallback when loading though.

To capture all room transitions in the debug messages you could open room_goto_fade and room_goto_fade_dontdestroy and add a line at the start (before the room is changed), this should point out if there's any room transitions happening so fast you don't get a chance to react:

show_debug_message(tsprintf("Room change % --> %",room_get_name(room),room_get_name(argument0)))

Did you add the debug message that prints the player's position after loading I suggested last time?

(+1)

Yes i did that after your last comment. I ended up just putting the overworld in the code and it spawned me correctly.  Now i got into the lab and everything works.  I may try to re input

the code of the indoors to see what happens.

Great, hopefully things go better this time! And as a rule of thumb, whenever you need to figure out what goes wrong, add more show_debug_message's in the code so you get all the info about what the game's trying to do.