general:astuces
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| general:astuces [2021/03/24 22:32] – [10. Comptage d'objet] editeurso | general:astuces [2022/09/25 17:11] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 398: | Ligne 398: | ||
| -> 21/10=2 | -> 21/10=2 | ||
| - | ===== 10. Comptage d'objet ===== | + | ===== 10. Comptage d'objets |
| - | Il n'est pas possible de connaitre combien d'objet du même nom (ex: Dague) possède un joueur dans son inventaire directement avec les commandes de l' | + | Il n'est pas possible de connaitre combien d'objets |
| - | Nous allons utiliser une astuce qui consiste à retirer le potentiel maximum de possession de l' | + | Nous allons utiliser une astuce qui consiste à retirer le potentiel maximum de possession de l' |
| + | |||
| + | Attention néanmoins : ce code ne fonctionne pas sur l' | ||
| __Exemple d' | __Exemple d' | ||
| Ligne 425: | Ligne 427: | ||
| Variable[15]=Variable[13]-Variable[14] | Variable[15]=Variable[13]-Variable[14] | ||
| //étape 4 : on redonne les dagues | //étape 4 : on redonne les dagues | ||
| + | //attention : ne fonctionne que le serveur réel | ||
| AddObject(Dague, | AddObject(Dague, | ||
| // | // | ||
| Ligne 436: | Ligne 439: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | __Réécriture de l' | ||
| + | < | ||
| + | <tr height=25>< | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | Appuie sur bouton | ||
| + | </ | ||
| + | </td> | ||
| + | <td width=20> | ||
| + | </td> | ||
| + | <td> | ||
| + | < | ||
| + | //étape 1 : nombre total d'item avant | ||
| + | Variable[13]=%NbObjetInventaire% | ||
| + | DelObject(Dague, | ||
| + | //étape 2 : nombre total d'item après | ||
| + | Variable[14]=%NbObjetInventaire% | ||
| + | //étape 3 : la différence donne la quantité de dague | ||
| + | Variable[15]=Variable[13]-Variable[14] | ||
| + | //étape 4 : on redonne les dagues | ||
| + | // ne fonctionne que sur le serveur REEL | ||
| + | // | ||
| + | // substitut pour tester sur votre éditeur light | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | Condition(' | ||
| + | AddObject(Dague, | ||
| + | // | ||
| + | Condition(' | ||
| + | // | ||
| + | // | ||
| + | // on peut utiliser la quantité ensuite | ||
| + | Message(' | ||
| + | // fin : réinitialisation des variables | ||
| + | Variable[13..15]=0 | ||
| + | |||
| + | </ | ||
| + | </td> | ||
| + | </tr> | ||
| + | </ | ||
| + | </ | ||
| + | |||
general/astuces.1616625134.txt.gz · Dernière modification : 2022/09/25 17:09 (modification externe)