Skip to content

Instantly share code, notes, and snippets.

@livvy94
Last active December 7, 2022 03:53
Show Gist options
  • Save livvy94/0049cc78aa3aeec9aec9e0a1822461de to your computer and use it in GitHub Desktop.
Save livvy94/0049cc78aa3aeec9aec9e0a1822461de to your computer and use it in GitHub Desktop.
This document contains every time I needed to ask for help in the slack chat, and what the solution was!

Question: Is there a way to do [something] in CCScript?

Answer: Check out the Command List! There's also this Syntax page too. And don't forget the CoilSnake Wiki!


Question: How do I change where Ness starts out from?

Answer: There's a command for just that! You'll probably also want to change the pointer of the initial string the game runs.

newgame_location(X,Y)

newgame_startup(titleOfTextBlockToRun)


Question: How do I link text to a TPT entry?

Answer: Look up the TPT number in npc_config_table.yml and change the first text pointer to a text block you wrote.


Question: How do I link text to a hotspot?

Answer: This is done in the map editor, you put it in a hotspot's properties. Though if you want to start a boss fight or something, doors with text attatched to them work better since you don't have to worry about them not reactivating after the player dies.


Question: How do I edit presents?

Answer: If a TPT is a present and you want to change what item's inside, the second pointer is where you put the item number.

Here's a list of all the items and what number they are. (though this info is in the item_configuration_table YML file too)


Question: How do I change which items/levels characters start off with?

Answer: initial_stats.yml


Question: How do I make it so a character starts with something equipped???

Answer: Use initial_stats.yml to make the weapon/armor/etc. be in the player's inventory, then put this in the newgame_startup text block from before:

[1F 83 XX YY]

XX = character number (01 is Ness, 02 is Paula, 03 is Jeff, 04 is Poo)

YY = position in their inventory (again, 00 is not the first one, despite what you'd think)


Question: How do I change item names and descriptions?

Answer: item_configuration_table.yml


Question: How do you make two party members face each other? I'm trying to make a cutscene-like thing, but char_direction(partymember, 0) depends on the right value being loaded for 0.

Answer: A custom command: char_look_at(partymember, partymember2)


Question: Is there any way to check if certain people are in your party or not?

Answer: HAVEN'T ASKED YET - however, event flags would probably be a good way to keep track


Question: How should I go about organizing my event flags? I have them at the top of my main script file, but I want to use them in other script files as well!

Answer: Make a flags.ccs file and stuff em all in there. Then when you want to reference a flag, you do this: set(flags.NessStubbedHisToe)


Question: How does the game know when to display Tony's "go back inside" message, and why can't I change it via data_31 in the script dump?

Answer: Its a hotspot you dip


Question: How do you disable the attract mode?

Answer: ROM[0xC422E4] = "[09]"


Question: How do you disable Dad's phone calls??

Answer:

ROM[0xC7D33E] = goto(StopBuggingMeDad)

StopBuggingMeDad:
  eob

Question: How do you disable the "Who are you talking to?" line?

Answer: Use the following code in a ccs file.

ROM[0xC7C588] = goto(ImTalkingToMyselfJeez)
ROM[0xC6BEf9] = goto(noResponse)

ImTalkingToMyselfJeez:
  "[06 94 02 {e(noResponse)}]" 
  window_closeall 
  eob

noResponse:
  "@(There's no response.)" end //I wouldn't have included this, but the above block is dependent on it being here.

Question: What are all of the valid enemy sprite sizes?

Answer: (0, 0), (32, 32), (64, 32), (32, 64), (64, 64), (128, 64), and (128, 128)

Enemy sprite palettes can be anything as long as they're 16 colors. Unlike overworld sprites, there's enough flexibility for CoilSnake to pull the color information from the actual PNG files.


Question: What are all of the valid overworld sprite sizes, and how do you change that information after you're done making the PNG?

Answer: You can choose any multiple of 8, but the max is 64x80 - it's what Dungeon Man uses.

There's some kind of configuration about how the minitiles in the sprite are put together. TODO: Try this and adjust this description based on trial and error

You'll need to change the size field in sprite_groups, and make the spritegroup image the equivalent size, for each frame.

If you're using something that's not normally used, like 24x32, you can usually just use the configuration for a larger sprite, like 32x32, and it should work fine.


Question: How would you go about animating something?

Answer: Use the commands usually used to make NPC sprites face different directions to switch "frames."

  pause(10)
  sound(88)
  npc_look(687,7)
  pause(10)
  npc_look(687,5)
  pause(30)

Also, there are three different kinds of NPC config table entries: person, object, and item.

Objects don't turn to face you when you interact with them, which is probably what you want if you don't want it switching to random frames of the animation.


Question: How do doors work in the map editor?

Answer: In Doors edit mode, right click to do stuff. Edit and use Warp coordinates. If you want to use doors, you have to make sure the collision data on whatever tile the door is on has the "door" value.


Question: What are the different warp styles you can apply to doors?

Answer: They are documented on this CoilSnake Wiki page!


Question: Collision data??

Answer: Check out this article on the CoilSnake Wiki!


Question: I've got a boss fight being triggered by the player walking on a hotspot, but if I die, I get sent back to the last save point with no way of reactivating the hotspot!

Answer: Doors with text attached to them are much more reliable for this sort of thing.


Question: I tried making a door and pointing it to a block of text in a ccs file a la battle start/death text, but it doesn't work. Do I really need to edit the collision data for a non-warping door?

Answer: yes


Question: Why does my boss have a normal swirl and not a boss swirl? I set the boss flag...

Answer: Enemy groups 448 and above all have boss swirls. The rest of them are all normal.


Question: I'm setting more than one battle background, but only one is displaying, and stuff seems to be glitching out. What gives?

Answer: See this page on the CoilSnake Wiki for info on battle background limitations.


Question: What does the letterbox size in enemy_groups.yml do?

Answer: 3 makes the letterbox just barely overlap with the top of the name cards. 0 disables it.


Question: My commands in menu blocks aren't working. What gives?

Answer: That's because they're all more than one line! Wrap them in brackets {}.

Also, if you want "default" text to display without making it an explicit option (like making the "No" in a Yes/No menu the "default"), just put the text out of scope of the menu, and it'll run if the player presses the B button.


Question: How do you use map_music.yml? I want to control whether a certain area plays one song or another with an event flag.

Answer: HAVEN'T ASKED YET


Question: After I use a warp, the controls are locked until I press the A Button once! How do I make it not do this?

Answer: HAVEN'T ASKED YET, but you probably need to use eob instead of next. experiment


Question: I have code for fading to black, but how do you fade to white?

Answer: HAVEN'T ASKED YET (I actually have, but I didn't write it down...)


Question: I want to use the Buzz Buzz light, but it keeps spawning Buzz Buzz? How do I ditch him lol

Answer: Comment out the Buzz Buzz-related stuff and you get this:

  BuzzBuzzLight:
  "[1F EA C5 00]" //[C5 00] here refers to the meteorite sprite
  "[1F 15 6A 00 36 00 01]" //sprite2_spawn(sprite,move,style)
  "[1F 61]" //activate the movement code
  eob

Question: Okay, but how do you get the light to appear onscreen? Nothing's happening...

Answer: It depends on the meteorite sprite being there. Move it to where you want the light to appear, and edit the sprite so it's all the transparent color if you want it to be invisible.


Question: Okay...but having the sprite there means there's an invisible barrier the player keeps bumping into.

Answer: One way to solve this is to arrange your map in a way that the sprite isn't in the player's way. However, if you want, you can modify the sprite's collision box in sprite_groups.yml

However, this only works with 16x16 sprites, so if it's bigger than that, you'll have to change it or there'll still be a couple of pixels' worth of collisionness at the bottom-center of the sprite.


Question: How do you just spawn the sprite from scratch? This is annoying and I want to try a different technique for this.

Answer: Okay! So, you use a command that's part of EB++.

USAGE: create_tpt_movaddr(entry, ptr, effect) //Spawns a TPT entry, pointed to by ptr, with an arbitrary movement pattern

Here's the command in action:

  create_tpt_movaddr (360, SpriteAppear, 1) //TPT number 360, pointer is the label SpriteAppear, and movement code 1

  SpriteAppear:
  {
    mov_setxy (3200, 4400) //set the X and Y coordinates the sprite appears at. 
    mov_pause (2) //I don't know what this does. Are there other things you can put in these brackets? 
    mov_jmlmov (0xC3A2AA) //assign movement code 8, "stand there and do nothing"
  } 

If you set text to the TPT entry, it'll run when you Talk (if it's an NPC) or Check (if it's an object). (with the exception being NPCs with enemy-like movement codes (597 to 603), like the girl in Happy Happy Village, which do their text when they bump into you)


Question: Okay I'm just going to put some cool control codes that I think I might need in the future here.

Answer: Here's one: [19 10 xx] - Return Character Number - it returns to the register the number of the character in your party's xxth slot. So you can do [19 10 00] and then say name(0) to get the name of the current party leader!


Question: How do you place magic butterflies? Is it an enemy group?

Answer: Yep it's group #425


Question: I have an item that's supposed to only work in battles, but it's switched and it only works in the overworld... It's item type 53...

Answer: Try setting it to 52


Non-hack stuff I want to remember

Question: Why isn't my .gitignore ignoring stuff? I haven't staged anything...

Answer: Remove any comments, make sure the .gitignore file uses UTF-8 encoding. Help is here! To unstage everything, use git rm -r --cached .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment