Forum Fighters: Rewritten (Discontinued)

i think option 2 is the better one. to simplify it we can have some sort of variable or function defined in the character clip to change characters

characterClip.setCharacter("pkhead");
characterClip.animation = "walk";

then in the character clip would be multiple frames storing the animations for each character. and the definition of the setCharacter function would be:

this.setCharacter = function(name) {
  this.gotoAndStop(name);
}

which is just basically an alias for gotoAndStop since all setCharacter does is call this.gotoAndStop and both functions have the same number of arguments and argument types, so you could probably change it to this

this.setCharacter = this.gotoAndStop;

which would make setCharacter a useless function, since because of the transitive property of equality you can just do this to set the character clip

characterClip.gotoAndStop("pkhead");

Um anyway. And then in each character frame code would go like this

this.lastAnim = null;

onEvent("update", function() { // this is to show that the following code should be in the update script, you can put it there if you like
  if (this.lastAnim !== parent.animation) { // if curr animation playing changed?
    this.gotoAndStop(parent.animation);
    this.lastAnim = parent.animation;
  }
});

Also, I have an idea on how to make option 2 take up more less space. Instead of having two identical clips for the two individual characters, have only one clip and make a separate clone for each character clip. In the controller clip will be a variable referencing its appropriate character clip.

// In the controller clip
this.character = characterClip.clone();
this.character.animation = "none";
(this.character.setCharacter || this.character.gotoAndStop)("pkhead");
// Use setCharacter if it's defined, otherwise use gotoAndStop instead.
// If you want to define a setCharacter function you can use that,
// even though it's going to be exactly the same as the gotoAndStop function.

onEvent("update", function() {
  this.character.animation = "none";

  if (walking) this.character.animation = "walking";

  if (grounded) {
    this.character.animation = "idle";
  } else {
    if (yVel >= 0) this.character.animation = "jumping";
    else this.character.animation = "falling";
  }

  this.character.x = this.x;
  this.character.y = this.y;
});

and then add code to delete the character in the unload script

1 Like

thats accually a good idea

the unload script is pretty iffy… and I’m sure you understand what you’re saying more than I do, so can you do the character thing before I do the attacks?

1 Like

I know a workaround for running the unload script

Why not explain that in the same post you’ve just made?
(edit: I meant in the same message but I should’ve clarified, i’m sorry)

Oh sorry. So when the unload script should be triggered, just put

objectName.runScript(‘unload’)

ok as a failsafe in the default script, if it has a character clip before defining the character clip it would remove it.

ok, tell me when you’re finished so i can do that. unless you’re already finished and i have to do that now, in which case you would tell me that you’re already finished.

is it possible to use external scripts and images?
i can make a firebase hosted app so it runs faster.

okay i sorta have an idea to how i can do it myself, but if I can’t get it to work then I’ll delegate the work to you.

1 Like

So I’m trying to use @Jovanny’s and @Hamzah_Alani’s clip moving thingy, and I’m running into some problems.

Basically, I’m trying to use it to obtain the characters from a different frame in the same layer. This is so that there is less lag on the game screen. I call it in each player like "this.char = project.cloneClip(blah blah blah). Those numbers are currently hardcoded but I will change that later.

The issue is that the code didn’t know what to do with the child index. I changed window.cloneClip to project.cloneClip to see if that was the problem, but the same problem occurred.

The cloneClip function is in “funcs and player list”. I call the function in each of the 2 players. The characters are in layer 2, frame 20.

If anyone finds a solution, please tell me how you did it.

FFR 1.0.03-12-2021_17-26-03.wick (20.1 KB)

2 Likes

I’m working on it… I have problems as well using it for Flashy Adventures… There are some things that I didn’t consider… Like, the indexes for frames are not necessary in order… and also if a frame measures more than one unit, it is still considered the same frame…

Using this, we can’t remove the clones from the current frame either… since the original is in other frame, when we do clone.remove(); It doesn’t do it…

Screen Shot 2021-03-12 at 9.53.11 PM

@Hamzah_Alani @awc95014, sorry, I tried several things, that I’m not able to remove the clones and the workaround would be so ugly that I doubt it would help… I think that I would not be able to use this for my game.

Sorry for the trouble, I just tested it a bit, and found a fix for this. If you use, “addChild()” instead of “addClip(),” then it should work a normal way any object would work and you’ll be able to remove the object when needed (and all code should run more properly this time).

3 Likes

Yup, it idid, work indeed. Thank you.

2 Likes

@awc95014, let me know if you need assistance or any kind of help with regards the Fighting Engine.

1 Like

I’m getting a similar problem here. Don’t know how to fix it.

FFR 1.0.03-14-2021_10-13-43.wick (20.8 KB)

1 Like

Let me take a look…

I had to add more functions to accomplish it, but it is working now.
FFR 1.0.03-14-2021_14-08-08.wick (24.6 KB)

(Also see frame 30)

2 Likes

thanks, that helped a ton :smiley:

So I think I can call this 1.1.0 now. parts 1 and 2 are (actually) done now.

and i actually think that this step, the 2nd to last step…

should come much earlier. like about now. this is a good skeleton for our game and we can fill in stuff. i’m gonna go edit the post with this.

i’m gonna give the attack/health work to someone else. after i make placeholder menus, someone can take the job of adding (placeholder) attacks/health. here are a few suggestions (you don’t have to do them, but it would be super helpful) or stuff like that for the sake of options and variety in players’ attacks.

  • add knockback in x and y coordinates when attacks are successful.
  • add animations.
  • add “cooldown” between pressing the attack key and actually attacking. (for example, a ball takes time to wind up and throw)
  • add cooldown between usages of attacks.
  • make combo attacks. (press attack button, 1 punch; hold attack button, 3 punches)

maybe make these edits inside the character clips (NOT the player clips). they’re on frame 30.

FFR 1.1.03-14-2021_12-57-57.wick (24.3 KB)

4 Likes

Could prob do the base design of about menu, have to do later I’m not home rn