Comment faire aller et venir l'ennemi?


#21

I think the problem is you’re checking if Angie is moving, which is part of the TopDownMovement behaviour, but you’re moving Angie using the pathfinding.

As Angie is not getting moved by the TopDownMovement behaviour, it won’t be registering Angie as moving. Instead, you could check Angie’s speed using the pathfinding function Speed, and if it’s more than 0 then Angie is moving.

Also, if you’re moving Angie with pathfinding, to get Angie’s angle along the path you’ll have to use Angie.Angle().


#22

Thanks! I deleted the topdown condition “Angie is moving”, and added the event at the bottom. What should be the action for this new condition? By the way, the enemy AI is still just doing her idle, but I am feeling like I could live with that, especially with the difficulties that arise when I try to rotate an isometric character.


#23

Also, I have all the playable characters shooting now, but with two problems. 1. I made my first try at pointing the playable character at the enemy, but they flop around like this. The idle on the playable characters, by the way, has them facing away from the camera, toward the general direction of the enemy. 2. The sound effects for the shooting all play at once when I have the selected character shooting. How do I only have the shooting sound for the current character play? Do I need a variable?


#24

Yes, because the events are telling the game to do this:

With this code, you’ll be creating 4 bullets, 3 at 0,0 (because the 3 of the player characters don’t exist and it’s the default co-ordinate GDevelop uses) and the last bullet at the character point Firing.

You need to have one “Space key is pressed” condition, and then a series of subconditions that check the Character.ObjectName() and act accordingly.

You need to go through your events, like GDevelop would, and workl out what it’s doing. And read not what you want it to do, but what it is doing.

image
This is a condition, that says “Is Angie’s angle = Angie’s angle?”. It’ll always be true.

I’d seriously recommend you park this project, and work on a series of smaller projects that help you to understand how GDevelop works. The help you’ve been asking for in the forums generally involves some rudimentary GDevelop functionality. Like all bullet sounds playing at once, like NPC moving in synch with the player etc, I get the feeling with this project you’ve bitten off more than you can chew. Take smaller bites, and work up to the main project.


#25

Here’s the irony of the situation. When I first picked up GDevelop, of all the crazy things, an idea popped into my head for an adult game. Believe me, my goal is not to be a pornographer,
but my forte is making beautiful 3D female characters, and I was certain I could create a 3-playable-level game of this concept, and also that by just changing the character, I could easily make infinite versions of the game. That was going to be my practice, so that I could then make my real, epic sci fi game. And I made the game without any real difficulties. I modified the platformer format into a “shooting gallery”, basically a first person shooter with a static firing point, and an AI enemy running back and forth on a platform as the “target”. I call it “The Perv Game” LOL. But I just made it for laughs and practice. Where could I even post an adult game? So that’s why I was overconfident coming into my real game. Unfortunately, though your advice makes perfect sense, I am old, laid off from work due to the fake pandemic, and I feel like if I don’t do this now, it is never going to happen. I am an artist, animator, and musician. My goal has never been to become a developer, just to complete my sci fi game. So I’ll attempt to finish it in whatever form I am able, and build it as a very basic first version/work in progress. And again, thanks much for your help. I am assuming that the condition above is where I need to slot different numbers between the parenthesis to try out different angles, so I’ll grab some more tutorials and proceed from there.


#26

No, you need to replace the green Angie.Angle() with the angle as a number.


#27

Thanks! Oh, man, the post must be at least 20 characters.


#28

For example on GameJolt. There are many games with different age limits in this place


#29

Thanks very much! I had never heard of this site.
For anyone who is interested, Gamejolt is an excellent site for posting games in general. They are pretty strict on maturity level stuff, however, and put a mature filter over my sci fi game, because it has a little (female android) artistic nudity. If anyone is making an actual “adult” game, though you could technically post it on Gamejolt, it would be out of place. The best site for posting such games is F95Zone.


#30

The series of subconditions are functions? When I do it like this, only the event works. The subevents do not occur. I realize that the selected playable character cannot fire the beam as well as her own specific projectile, but I don’t know what to put here. I have watched many tutorials, but cannot find one that deals with this.


Current Animation
Game FB Page


#31

You’re missing the ‘()’ from most of the ObjectName references - you have it for Kirsti, but not the others.

Also, check you are comparing strings, and not numbers. You’ll have to double click on the event condition to see which one it is. Make sure the expression has no red to it in the editor.


#32

Thanks, I put in the two missing sets of"()"'s. I also checked inside the conditions, and they are all comparing strings. At some point, I have to get rid of that action at the top,because it is redundant, correct? At this time though, it is the only reason the characters are able to shoot. When I delete that action, the characters dont shoot at all. Eventually, when the subevents are functioning, I should have nothing there, right? So the functions and their actions look OK? Each character has Topdown Movement and Fire Bullet behaviors on them.


#33

I just noticed this, you have Character.ObjectName(). It’s Characters, with an ‘s’ on the end. When creating the events conditions and actions, it’s best to start typing in an object name, and then selecting it from the list. Then you know you’ve got it right.

Yes.


#34

Thanks, that was the problem! That’s what I mean when I say I am very right-brained, all creativity and not a lot of logic. It was my first time using functions, and for some reason I thought the “Character” in the functions was something separate from the group “Characters”. Anyway, now I can move on, and at least complete a basic version of this game. I think I am starting to understand what Silverstreak meant when he said I am going into new territory. In iClone, when I made the animations, I tilted all the characters so that they would match the perceived angle in the isometric background. In all the tutorials I’ve viewed, I haven’t seen anyone doing this, and it creates challenges that aren’t present in a straight topdown game.


#35

Hey Mr. Men!
I am currently experimenting with my playable characters firing projectiles while moving in different directions, as you basically advised me to a while back. I’ve only added one subevent so far (for walking right) to attempt to match the projectile angle to the player angle. As I substitute different angles, I am getting some strange results. I’ll keep on using trial and error, to see what happens, but I was wondering if you might have some further guidance. Also, when Kristi moves up/left, she doesn’t fire at all for some reason. Events and video attached. Also, I think it is inevitable that my game is going to have loading pauses, even with everything optimized. Is it possible to have a loading graphic like in the old school games 20 years ago?
Video


#36

You’re using 2 different types of forces - one with using x & y components, the other using angle and length. I suggest you use force angle - it’s simple enough as you have only 8 directions of movement. and they’ll be multiples of 45. 0 degrees is directly to the right, and angles increase in a clockwise direction (and conversely, decrease in the anti-clockwise direction). It’ll also make it easier to change the angle of the beam (and the other character’s projectiles too).


My code change suggestions further down are on the assumption that:

  • there is one idle animation sequence, and it’s the first animation for each character
  • the character move animations in rotational order, so the first one is to the right, second down right, third is down and so on. This is important as it makes the code so, so much simpler.
  • the character move animations start as the second animation for each character (first one is idle).
  • the Beam image (and this goes for all the projectiles), is horizontal and facing to the right. It’s all to do with GDevelop having the angle 0 being to the right, and not up the screen.

Once the animations in the right order, make the following changes :

  • remove the right key pressed subevent. It won’t be needed as we can determine the angle based on the character’s animation number.
  • in the second event (the one that checks if character name is Kirsti), change the force action to an “Add force (angle)” action, with angle (Characters.Animation()-1) * 45 and length 100
  • modify the action to change the beam angle to use the angle (Characters.Animation()-1) * 45

I think that should be it.


#37

Thanks much for the extensive instructions! I’ve only done Kristi so far (it’s a bit of an undertaking). I followed the directions to the best of my GDevelop ability (I know that’s not saying much! LOL). Of course, I didn’t have the animations in anywhere near the correct order. Also, whenever I bring in an animation, there are always some idle frames at the end that have to be determined in Piskel and removed, so redoing all those was probably the most time consuming part, then I redid the key press events to match the new animation order. I think there is only one problem with the result: the beam is generated but it doesn’t move. Do I need another force? You’ll probably also notice, in the video, that Kristi can’t shoot when she’s moving in the left/up direction. I just get a beep, like an error sound. It has been like that the whole time, and I have no idea why she can’t fire when moving in that one direction.


Video


#38

Make the force a permanent one. An instance force is only for the current frame, and not subsequent ones.


#39

Ah, thank you! She’s shooting close to how I want her to now, when walking forward or right. That’s half the battle, since those are the directions facing the enemy. Any idea why the beams go diagonal when she’s idling?


video


#40

Yes, because idling is animation 0, and (0 - 1) *45 = -45. Not something I had envisage.

To get earound this, you could put 2 subevents off the “Characters.ObjectName = Kirsti” event :

  • First one that checks if the Kirti’s animation is idling as the condition, and fires a beam at 270 degrees.
  • Second one that has the condition as an inverted version of the first, and uses the actions you have at present.