| Comment faire suivre un object ? | |
|
+8Ablationer Bloue Devil37 lefouineur OMZ edi9999 M@d_Doc Frugalware 12 participants |
|
Auteur | Message |
---|
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:29 | |
| Bonjour à tous. J'ai un petit problème avec game maker, normalemant j'arrive toujour à trouver une solution à mon problème en trafiquant toute les possibilités, mais la, j'en sert rien. je suis en plein travaille sur un proger et mon problème est le suivant : j'ai créer un personnage que je guide grace à la souri, et j'ai créer d'autre perssonnages qui doivent être automatiquement controler, il doivent me suivre à une vitesse trés lente (des zombies ^^) mais je ne c'est pas comment faire pour qu'il me suive. voila j'espere pouvoir être aide ![rouge](/users/3412/18/80/54/smiles/953970.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
M@d_Doc Modérateur
![M@d_Doc](https://2img.net/u/3412/18/80/54/avatars/7-77.png)
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:34 | |
| dans le step du zombie : mp_potential_step(joueur.x,joueur.y,vitess,0) avc : joueur : nom de l'objet que les zombies doivent approcher vitess ; ... ben la vitesse, quoi ^^ |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
edi9999 Utilisateur confirmé: Rang *****
![edi9999](https://2img.net/u/3412/18/80/54/avatars/288-99.jpg)
Messages : 2480 Localisation : France Projet Actuel : theatre flashy
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:34 | |
| dans step move_towards_point(obj_principal.x,obj_principal.y,speed)
obj_principal a remplacer par l objet a suivre speed a remplacer par la valeur de la vitesse en pixel/step edit : post quasi simultané mad doc |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:39 | |
| merci a vous, mais j'ai deja fait cette methode mais quand je change d'aparence (j'ai un pistolet) une erreur saffiche indiquand que l'expression n'est pas valide ![snif](/users/3412/18/80/54/smiles/846663.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
OMZ Utilisateur confirmé: Rang **
![OMZ](https://2img.net/u/3412/18/80/54/avatars/804-45.jpg)
Messages : 350 Localisation : Sur ordi Projet Actuel : Reparer mon Ordi
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:49 | |
| Tu change juste de sprite ou aussi d'objet quand tu prends le pistolet ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:50 | |
| |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
OMZ Utilisateur confirmé: Rang **
![OMZ](https://2img.net/u/3412/18/80/54/avatars/804-45.jpg)
Messages : 350 Localisation : Sur ordi Projet Actuel : Reparer mon Ordi
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:55 | |
| C'est normal alors ... Je crois qu'il faut trouver un truc avec if et qui dit que si ton objet perso non armé n'existe plus , le zombie doit suivre l'objet perso_armé mais je sais pas comment faire un "if perso existe pas " |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
edi9999 Utilisateur confirmé: Rang *****
![edi9999](https://2img.net/u/3412/18/80/54/avatars/288-99.jpg)
Messages : 2480 Localisation : France Projet Actuel : theatre flashy
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:56 | |
| eh bien alors
if instance_number(obj_principal)>=1 move_towards_point(obj_principal.x,obj_principal.y,speed)
if instance_number(obj_pistolet)>=1 move_towards_point(obj_pistolet.x,obj_pistolet.y,speed)
eh voila tu peux le faire avec une infinité d instances comme ca |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 20:58 | |
| mais enfet j'ai 5 voir + par la suite d'arme diferente
EDIT :
obj_principale je le remplace par le mien ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
OMZ Utilisateur confirmé: Rang **
![OMZ](https://2img.net/u/3412/18/80/54/avatars/804-45.jpg)
Messages : 350 Localisation : Sur ordi Projet Actuel : Reparer mon Ordi
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 21:01 | |
| Regarde 1 post avant : je crois que c'est en enchainant les codes de edi9999 mais je crois que si par inadvertance tu met dans une room un perso non armé et un armé ca va bugger ... Enfin bref il suffit d'enchainner les codes ecrits par edi9999 pour tout tes objets de perso armé |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 21:05 | |
| j'ai toujours un message d'erreur avec (nom du perso).x et .y |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
edi9999 Utilisateur confirmé: Rang *****
![edi9999](https://2img.net/u/3412/18/80/54/avatars/288-99.jpg)
Messages : 2480 Localisation : France Projet Actuel : theatre flashy
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 21:06 | |
| |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 21:08 | |
| a non c'est bon j'ai oubli d'enlever le ancienne commande dans un autre object merci a tous EDIT :Juste une petite question encor ![happy1](/users/3412/18/80/54/smiles/922323.png) comment on peut orienter le zombie de fasson à se qui marche vers moi et pas qu'il soit toujour de droite ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
lefouineur Utilisateur confirmé: Rang *****
![lefouineur](https://2img.net/u/3412/18/80/54/avatars/142-97.jpg)
Messages : 2015 Localisation : En train de regarder Bast qui perché sur un arbre mais qui voit bien que romain6513 l'espionne ! lol Projet Actuel : The Power
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Sam 5 Jan 2008 - 23:35 | |
| Un - Code:
-
image_angle=direction pourrait être utile ? A mettre dans le step du zombie. |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Lun 7 Jan 2008 - 19:22 | |
| sa c'est de la reponce rapide je vous en remerci, merci EDIT :j'oubler un truc important mais comme je sui nul en programmation je peux pas le deviner qu'est qu'il faut que je modifi dans le code de edi9999 pour que les zombie contourne les obstacles solide ![:question: ❓](https://cdn.jsdelivr.net/emojione/assets/png/2753.png?v=2.2.7) ,merci |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Devil37 Utilisateur confirmé: Rang *****
![Devil37](https://i.servimg.com/u/f44/11/44/36/20/devil310.jpg)
Messages : 1815
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Lun 7 Jan 2008 - 19:56 | |
| Avec ce qu'il a fait, si tu veux contourner les objets solides, et bien tout :gniah: Non mais regarde dans l'aide, tu trouvera presque tout : - Citation :
- mp_potential_step(x,y,stepsize,checkall) De la même façon que les fonctions précédentes, cette fonction déplace d'un step l'instance en direction d'une position particulière. Mais dans ce cas précis, elle essayera d'éviter les obstacles. Quand l'instance se dirigera vers une instance solide (ou n'importe laquelle instance si le paramètre checkall vaut true), elle changera la direction du mouvement afin d'éviter l'instance et la contournera. Le fonctionnement n'est pas guarantie mais dans la plupart des cas, cette fonction déplacera l'instance vers la cible. La fonction retourne si la cible a été atteinte ou pas.
Section: La planification des mouvements ... |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Lun 7 Jan 2008 - 20:22 | |
| merci mais...... je sais pas se qui ont, ils tourne tous sur eux même ![rire2](/users/3412/18/80/54/smiles/567159.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 18:27 | |
| C'est normal, les actions d'un zombies sont parfois étranges ![super](/users/3412/18/80/54/smiles/684630.png) . |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 18:56 | |
| oué mais bon, pk sa fait sa quoi ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:06 | |
| image_angle peut faire ça, tu peut montrer le code où il y a un image_angle dedant ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:08 | |
| bé image_angle je les mis dans un scripte apar - Code:
-
image_angle=direction |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:09 | |
| a ok, si ton jeu est vu de haut ça va.
mais dans un autre script tu n'a pas mis un direction= ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:12 | |
| le zombie il a un event step ou j'ai mis 2 scripte - Code:
-
if instance_number(perso)>=1 move_towards_point(perso.x,perso.y,1.5)
if instance_number(perso_pistolet)>=1 move_towards_point(perso_pistolet.x,perso_pistolet.y,1.5)
if instance_number(perso_fusil)>=1 move_towards_point(perso_fusil.x,perso_fusil.y,1.5)
if instance_number(perso_mp44)>=1 move_towards_point(perso_mp44.x,perso_mp44.y,1.5)
if instance_number(perso_uzi)>=1 move_towards_point(perso_uzi.x,perso_uzi.y,1.5)
et le deusième - Code:
-
image_angle=direction |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:18 | |
| - dimitrou a écrit:
- le zombie il a un event step ou j'ai mis 2 scripte
- Code:
-
if instance_number(perso)>=1 move_towards_point(perso.x,perso.y,1.5)
if instance_number(perso_pistolet)>=1 move_towards_point(perso_pistolet.x,perso_pistolet.y,1.5)
if instance_number(perso_fusil)>=1 move_towards_point(perso_fusil.x,perso_fusil.y,1.5)
if instance_number(perso_mp44)>=1 move_towards_point(perso_mp44.x,perso_mp44.y,1.5)
if instance_number(perso_uzi)>=1 move_towards_point(perso_uzi.x,perso_uzi.y,1.5)
et le deusième
- Code:
-
image_angle=direction peut etre si tu met ça ? - Code:
-
if instance_number(perso)>=1 direction=(perso.x,perso.y,1.5)
if instance_number(perso_pistolet)>=1 direction=(perso_pistolet.x,perso_pistolet.y,1.5)
if instance_number(perso_fusil)>=1 direction=(perso_fusil.x,perso_fusil.y,1.5)
if instance_number(perso_mp44)>=1 direction=(perso_mp44.x,perso_mp44.y,1.5)
if instance_number(perso_uzi)>=1 direction=(perso_uzi.x,perso_uzi.y,1.5)
|
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:20 | |
| oué peut-être mais je voulez qui évite les obstacle sinon il s'arrete devant un mur |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:32 | |
| euh j'ai une idée mais si j'ai le temp je posterais plus tard 'vai manger.
si tu retrouve un topic ou je demande comment savoir si 3 objets sont alignés, tu me le dis, ok ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:34 | |
| ok lol, tu ses plus ou il est ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Mar 8 Jan 2008 - 19:37 | |
| non, il a du couler dans aide débutants^^. |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Frugalware Très bonne participation
![Frugalware](https://2img.net/u/3412/18/80/54/avatars/970-6.jpg)
Messages : 160 Projet Actuel : Zombad
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Jeu 10 Jan 2008 - 19:54 | |
| ![fleche_d](/users/3412/18/80/54/smiles/950380.png) Une reponse ![fleche_g](/users/3412/18/80/54/smiles/880393.png) :p_svp: |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Bloue Utilisateur confirmé: Rang **
![Bloue](https://2img.net/u/3412/18/80/54/avatars/871-62.jpg)
Messages : 443
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? Jeu 10 Jan 2008 - 20:38 | |
| Je trouve plus mon topic :gniah: . |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Contenu sponsorisé
![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | Sujet: Re: Comment faire suivre un object ? ![Comment faire suivre un object ? Empty](https://2img.net/i/empty.gif) | |
| |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
| Comment faire suivre un object ? | |
|