C-Dawg wrote:Are you coding these weapons in the same way I am? That is, FFC scripts running on FFCs 29, 30, 31?We'll want to synthesize all weapons into a single easy-to-use script before we finish the toolbox. To that end, I'm going to be re-scripting my custom weapons to be more modular.
Well as a matter of fact, I am. Well ffc 25-29 to be exact, as the global weapon script I was working on ran into a few problems one could say. I still would like to get one scripted for the benefit of people that know squat about scripting, as it was designed to be really easy to use. Some global variables and item[D] variables, and that's really it. No messing with ffc's at all. I haven't given up though because I think the community needs one.
Bact to ffc's: Well I kinda broke the script into 3 sections, didn't change anything though, for example ;
//========================================================
// ITEM SCRIPT MAKANITO
// translation: deadly air
// It creates a vacuum that sucks in nearby enemies
// and can kill them instantly.
// At a high level this is probably the most powerful
// attack in the game. exp must be set accordingly.
// D0 - the CSet of the projectile
//=========================================================item script Makanito{
void run (int cset){
int deadly_air_combo = 10;
ffc deadly_air = Screen->LoadFFC(29);
if (makanito_level == 1){
Game->PlaySound(11);
makanito_exp++;
if(Link->Dir == 0) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y - 16;
deadly_air->Vy = -1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo;
deadly_air->CSet = cset;
}
if(Link->Dir == 1) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y + 16;
deadly_air->Vy = 1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo;
deadly_air->CSet = cset;
}
if(Link->Dir == 2) {
deadly_air->X = Link->X - 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = -1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo;
deadly_air->CSet = cset;
}
if(Link->Dir == 3) {
deadly_air->X = Link->X + 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = 1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo;
deadly_air->CSet = cset;
}
}
else{
if (makanito_level == 2){
Game->PlaySound(35);
makanito_exp++;
if(Link->Dir == 0) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y - 16;
deadly_air->Vy = -1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+1;
deadly_air->CSet = cset;
}
if(Link->Dir == 1) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y + 16;
deadly_air->Vy = 1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+1;
deadly_air->CSet = cset;
}
if(Link->Dir == 2) {
deadly_air->X = Link->X - 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = -1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+1;
deadly_air->CSet = cset;
}
if(Link->Dir == 3) {
deadly_air->X = Link->X + 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = 1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+1;
deadly_air->CSet = cset;
}
}
else{
if (makanito_level == 3){
Game->PlaySound(35);
makanito_exp++;
if(Link->Dir == 0) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y - 16;
deadly_air->Vy = -1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+2;
deadly_air->CSet = cset;
}
if(Link->Dir == 1) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y + 16;
deadly_air->Vy = 1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+2;
deadly_air->CSet = cset;
}
if(Link->Dir == 2) {
deadly_air->X = Link->X - 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = -1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+2;
deadly_air->CSet = cset;
}
if(Link->Dir == 3) {
deadly_air->X = Link->X + 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = 1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+2;
deadly_air->CSet = cset;
}
}
else{
if (makanito_level == 4){
Game->PlaySound(35);
makanito_exp++;
if(Link->Dir == 0) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y - 16;
deadly_air->Vy = -1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+3;
deadly_air->CSet = cset;
}
if(Link->Dir == 1) {
deadly_air->X = Link->X;
deadly_air->Y = Link->Y + 16;
deadly_air->Vy = 1;
deadly_air->Vx = 0;
deadly_air->Data = deadly_air_combo+3;
deadly_air->CSet = cset;
}
if(Link->Dir == 2) {
deadly_air->X = Link->X - 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = -1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+3;
deadly_air->CSet = cset;
}
if(Link->Dir == 3) {
deadly_air->X = Link->X + 16;
deadly_air->Y = Link->Y;
deadly_air->Vx = 1;
deadly_air->Vy = 0;
deadly_air->Data = deadly_air_combo+3;
deadly_air->CSet = cset;
}
}}}} //end of else statements
}
}
And the jist of the general weapon part:
// =================================
// MAKANITO MOVEMENT
// ================================= if(this_ffc->Data == beam_animation_makanito){
damage = 1;
if ( (!(this_ffc->Data == beam_animation_makanito))||(this_ffc->X < 10) || (this_ffc->X > 230) || (this_ffc->Y > 150) || (this_ffc->Y < 10)){
this_ffc->Data = 1;
this_ffc->CSet = 0;
wobble = 0;
initialize = 0;
this_ffc->X = 16;
this_ffc->Y = 16;
}
}
else{
With this added inside the while(enemy->IsValid) part:
//==============================================================================
// *MAKANITO VACUUM EFFECT* if( ( (this_ffc->Data == beam_animation_makanito) || (this_ffc->Data == beam_animation_makanito+1) ||
(this_ffc->Data == beam_animation_makanito+2) || (this_ffc->Data == beam_animation_makanito+3) )
&& (Screen->ComboS[ComboAt(this_ffc->X+8, this_ffc->Y+8)] == 0) && !(current_enemy->Tile==0) ){
if((this_ffc->X > current_enemy->X) && (this_ffc->X < current_enemy->X+32)
&& (this_ffc->Y > current_enemy->Y-32) && (this_ffc->Y < current_enemy->Y+32)){current_enemy->X++;}
if((this_ffc->X < current_enemy->X) && (this_ffc->X > current_enemy->X-32)
&& (this_ffc->Y > current_enemy->Y-32) && (this_ffc->Y < current_enemy->Y+32)){current_enemy->X--;}
if((this_ffc->Y > current_enemy->Y) && (this_ffc->Y < current_enemy->Y+32)
&& (this_ffc->X > current_enemy->X-32) && (this_ffc->X < current_enemy->X+32)){current_enemy->Y++;}
if((this_ffc->Y < current_enemy->Y) && (this_ffc->Y > current_enemy->Y-32)
&& (this_ffc->X > current_enemy->X-32) && (this_ffc->X < current_enemy->X+32)){current_enemy->Y--;}
}
//===============================================================================
And some variables, with the experience points handled mainly by the Global Script. As you can see though, they aren't nearly done yet, but I'll have some cool stuff to showcase soon enough. 😊
Also, I can't believe no one's done this yet (maybe no ones thought of it...?) but people complain about inputR and inputL as running out of buttons to script stuff to. But what about multiple inputs? for example do you need jump AND slide to be different buttons in a side scroller? ...just an idea.
C-Dawg wrote:Take a look at my SHMUP enemy script. Notice how I can just keep adding enemies by adding two "if" statements? Thats what I'm going for with weapons. That way, you can add more just by sticking stuff into the code and not changing anything else.If I have time, I'll set that up this weekend so you can just create code to dump into the weapon script.
Isn't it set up kinda like that already? :shrug:
I fixed the pallete distopia(finally) enabling me to add enemies at last. Got a bunch of weapons rolling...enough for a demo at some point, more recoloring ect.. It's actually very easy to use now. 😊 With 3 csets to spare (5, 10, and 11.) 10 and 11 is actually 0 and 1, but with a purple for ripping ease. enough rambling though.
Thoughts? MegaMan_Tileset_ver0.5_b584
Edit: Well that versions almost obsolete now, I worked on it a bit more. 😊 I would like to add a scripting base to it though, something simple, just some weapon stuff. A few to start with, nothing crazy. Maybe megashooter, metal blade, and work from that. The roc's feather will work for the time being. You mentioned a slightly moded version of GW, so I'll wait for that. Also I was thinking to add a [D] variable so the enemy cset flashing and knockback is disabled by default unless specified by the author.
Oh, and started comboing...Wow, it's so easy to make screens for these sidescrollers, a demo and working tileset is not that far off. ...also added weapon/item sprites from gba and snes games, for forwards compat, should anyone want to add updated tiles...right now i'm pleased with the way the NES graphics actually look. Wasn't too sure untill I started actually using them.