Salut.
Mon objectif est de rĂ©soudre un petit problĂšme, jâai parcouru des tutoriels sans fin, refait les Ă©vĂ©nements plusieurs fois, mais lâennemi Angie (bleu) ne patrouille toujours pas dans les deux directions. Lorsque la scĂšne sâouvre, elle se dĂ©place avec son animation âDroiteâ vers lâobstacle âAller Ă gaucheâ et y reste (elle sâapproche du personnage jouable argentĂ© quand il se trouve Ă portĂ©e). Personne dans les forums ne mâa aidĂ© Ă rĂ©soudre ce problĂšme. La seule personne qui a Ă©tĂ© utile (avec un problĂšme prĂ©cĂ©dent) Ă©tait MrMen. AprĂšs que personne nâait aidĂ© Ă rĂ©soudre mon problĂšme, jâai suggĂ©rĂ© de tĂ©lĂ©charger le projet sur mon Google Drive, afin que quelquâun puisse entrer dans le projet, pouvoir tout voir et repĂ©rer le problĂšme. Ce que je veux, câest que le personnage ennemi (bleu) fasse des allers-retours (ou mĂȘme simplement inactif), et utilise ses autres animations. Je suis artiste et animateur. Je nâai pas lâintention de devenir dĂ©veloppeur. Je veux juste faire ce jeu de mon concept de science-fiction.
FB page for game
Vous avez une boucle infinie dans le cadre rouge.
Lorsque Angie Ă vu lâautre personnage elle va le voir.
Et quand Angie est proche du personnage vous laissez Ă 1 la variable seeyou que vous utilisez dans lâĂ©vĂšnement au dessus. Donc Angie tourne infiniment en rond autour du personnage.
Changez seeyou = 0 pour que Angie ne soit pas attiré vers le personnage quand elle est déjà à cÎté.
Salut. Jâavais oubliĂ© quâen plus de MrMen, vous Ă©tiez Ă©galement utile dans les forums anglais. Je mâexcuse. Le principal problĂšme que jâai est que Angie, ennemie bleue, ne fait pas de va-et-vient entre les obstacles âGoLeftâ et âGoRightâ. Le problĂšme secondaire est que, pendant tout cela, elle nâutilise que son animation «Right». Sur la base de votre suggestion concernant les nombres utilisĂ©s avec la variable «seeyou», jâai essayĂ© les 4 possibilitĂ©s. Tels Ă©taient les rĂ©sultats. 1,0 Angie dĂ©mĂ©nage Ă GoLeft et y reste. Quand le personnage jouable argentĂ© Kristi sâapproche, Angie se dirige vers elle. Kristi peut sâĂ©chapper lorsquâelle atteint une certaine distance. Câest vraiment bien, sauf quâAngie utilise toujours son animation de marche Ă droite.
0,1 Angie se dirige immédiatement vers Kristi, puis fait des allers-retours entre Kristi et GoRight.
0,0 et 0,1 sont complĂštement faux. Donc, pour revenir Ă essayer de faire passer lâennemi bleu Angie entre GoLeft et GoRight, puis aller voir Kristi quand Kristi sâapproche, pour le moment, je nâai que la variable âseeyouâ sur Angie, valeur â0â. Est-ce correct? Dâautres suggestions? Jâai le sentiment que quelquâun a besoin dâentrer dans le projet, oĂč il peut tout voir, et saura alors pourquoi Angie ne traverse pas entre les deux obstacles et nâutilise quâune de ses animations. De plus, mon projet se charge dĂ©jĂ trĂšs lentement, jâai tout optimisĂ©, et je nâai mĂȘme pas ajoutĂ© les animations pour le personnage AI dans la scĂšne 2 et la scĂšne 3.
Vous avez des animations dans le personnage, une animation vers la gauche et une autre vers la droite.
Câest bien, mais dans ce cas vous ,nâavez pas besoin de faire un âflipâ sur le personnage.
Lâaction âflipâ est utile pour retournĂ© lâobjet si vous nâavez pas dâautres animations.
Faut faire un choix entre âflipâ ou les animations.
Quand je change les âflip horizontalâ en ânoâ, ou que je supprime les âflip horizontalâ, Angie va toujours immĂ©diatement au âGoLeftâ et y reste. La seule diffĂ©rence est que maintenant elle fait son animation de marche Ă gauche au lieu de sa marche Ă droite. Je ne pensais pas avoir la possibilitĂ© de supprimer ses animations au lieu des flips, tout comme jâaurais aimĂ© gagner de la place, car elle aura besoin des animations pour chasser le personnage jouable, nâest-ce pas? Quâai-je manquĂ© pour quâAngie nâait jamais fait des allers-retours entre les obstacles comme prĂ©vu? Ai-je une mauvaise direction quelque part? Il me semble quâil ne devrait pas y avoir seulement la variable âsee youâ sur Anjie mais quelque chose dâautre. Puis-je lui ajouter une autre variable comme âDirection_Leftâ ou âLeft_0â?
Si la position dâAngie sur lâaxe X est plus petit que la position de Silver alors met lâanimation Right.
Si la position dâAngie est plus grande tu met lâanimation Left.
En résumé Angie est à gauche de Silver tu met son animation Right pour la faire face à Silver qui est à droite.
Et lâinverse pour lâautre cĂŽtĂ©.
Ne réfléchi pas avec des variables.
Réfléchi de ce dont tu a besoin. Tu regarde la situation, et tu réfléchi à ce qui ne va pas. Ne te lance pas dans des trucs compliqué rapidement.
Fait un Ă©tat de la situation avant dâagir.
Rebonjour!
Jâai renoncĂ© Ă essayer de faire traverser lâIA ennemie Angie entre les deux obstacles, car cela retarde trop le jeu et utilise trop de temps pour les gens. Jâai maintenant Ă la fois un behavior de pathfinding et de topdown sur Angie, comme je lâai rĂ©cemment vu dans un tutoriel. Quand la scĂšne sâouvre, Angie fait idle, ce qui est bien. Je crois que lorsque le personnage jouable Kristi sâapproche dâelle, Angie ira attaquer Kristi. Le problĂšme maintenant est que, dĂšs que je dĂ©place Kristi, Angie imite son comportement. Je nâai aucune idĂ©e de pourquoi cela se produit. Comment mâen dĂ©barrasser? Jâai fait une vidĂ©o rapide et lâai liĂ©e, afin que vous puissiez voir le problĂšme en action.
Merci
Video
Characters est un groupe contenant vos deux objets câest Ă cause de ça que les deux bougent en mĂȘme temps.
Sur Angie vous avez surement le comportement âtop-downâ, vous nâavez pas dĂ©sactivĂ© la case des touches par dĂ©faut. Câest touche qui bougent lâobjet sont les touches WASD ou/er les touches flĂ©chĂ©s.
Apologies in advance for using English in the French forum.
In the video you said both characters have top down behaviours. If thatâs the case, uncheck the default controls setting on Angie.
Merci, câĂ©tait le problĂšme! Jâai appris quelque chose aujourdâhui. JâespĂšre que cela nâa pas poussĂ© autre chose hors de mon cerveau. Peut-ĂȘtre que demain je ne pourrai pas attacher mes chaussures!
Hey MrMen! Good to see you! A lifesaver as usual! I finally gave up on having the AI patrol back and forth. It was becoming a lifelong pursuit in itself. I think itâs OK for the AI to just be idling. Iâm not even going to get rid of the GoRight & GoLeft obstacles, just hide them, for fear of creating new problems! Sorry I have a bunch of questions. I havenât seen you in a while, and you are the ultimate GDevelop guru! So at the moment, the only animation the enemy uses is her idle, even when she attacks the playble character. I do need to have her using her other animations, when the âseeyouâ variable comes into play (playable character approaches), and she goes after the playable character. Any idea how to do that? After that Iâm going to try to set up shooting for the playable character. If the playable character shoots the enemy, on to Scene 2. If the enemy comes into contact with the playable character, back to the beginning of Scene 1. Once all that is done, I would like to duplicate Scene 1 for Scenes 2 & 3, since the maps are just a little different, and the AI just needs to be changed. If I duplicate a scene, does it duplicate EVERYTHING: the events, the characters, their behaviors & variables, etc.? Lastly, is putting obstacles around the edge of each scene the best way to keep the characters from going off the edge of the screen? As you know, I have pretty much zero development skills, but I make good cut scenes, so Iâd be happy to help with that in your games if you like!
Best regards, Bill Carey
Youâll have to set the attack animation when she attacks, and the move or idle animations depending on the value âseeyouâ variable gets set to. None of this appears to be happening in the code snippet you provided.
Youâll also want to determine the direction the enemy is moving, and use the appropriate animations.
Take a look into using external layouts. They define the layout of the game objects without the having any code behind or variables. Effectively you have one base scene with variables, objects and events, and you use the external layout to define the placement of the graphics. This is perfect for multiple levels of the same style of game and the bonus is thereâs no code/event duplication.
Try it and see. The best way to learn coding with GDevelop is to give an idea a shot, and if it fails try another angle. But as I wrote earlier, external layouts appear to be a better option.
OK, thanks for all the info. I just tried duplicating Scene 1, so as not to start from scratch with Scenes 2 & 3, and the answer is yes, it does duplicate EVERYTHING. What app do you guys use to make videos from your game project? I donât suppose there is a free, easy-to-use one out there? I donât care if there is a watermark. I have been using MS Game Bar, and it is totally unsuitable. If I turn on the microphone, I get crazy background noise except when I am actually recording, and the audio in the project just comes thru as faint background noise. If I turn off the microphone, then the video has no audio, period.
I like to use sharex for taking footage of my work
Wow, thanks, perfect! With the Virtual Audio Capturer, including the projectâs audio is no problem. And no watermark!
Hey MrMen!
I managed to do Kristi1217âs laser beam eyes, and to prevent the characters from walking off the edge of the scene. But I have absolutely no idea how to make enemy AI Angie go into the correct animation depending upon what angle the playable character is at, relative to her. When the playable character gets over 300 pixels away, Angie can just go back into her whip-cracking idle. Though now Iâm thinking, that once Angieâs directional walk animations are functioning OK, if she actually reaches the playable character then the whip-cracking idle will have to come back, because she canât kill the playable character with a walk animation (even with those high heeled boots LOL).Video
Youâll have to use Angie.TopDownMovement::Angle() to get the angle sheâs facing (keep in mind, this could be negative, so 135 degrees is the same as -225 degrees).
To work the angles out, Iâd suggest you start a small project and test. Once you get a result, apply it to your main game.
For example, to get you the answer at the start of this message, I used an [almost empty[ existing project, added TopDownMovement behaviour to the sprite called Pivot_Brick, made a text box called debug, added the following single event and played with the arrow keys :
Hello again, MrMen! Please forgive my perpetual confused state! At the moment, I canât even get enemy Angie, who has topdown and pathfinding behavior, to do any animation other than number â0â, her idle. In the events, when Angie is moving, her animation should change to 1, which is (walk) Left, but it doesnât. Also in the events, when the âseeyouâ variable is 1, her animation should change to (walk) Left, but it doesnât. I probably shouldnât have both anyway, right? If I understand correctly, the angle stuff you are telling me to do would be in the action for the condition âthe variable seeyou of Angie is 1â? But right now, changing her animation for this condition does not seem to be happening at all.