| Autor |
Nachricht |
| < Wie gibt man dem Spieler am besten etwas in die Hand? |
|
Verfasst am:
Fr, 7 Jan 2011 - 11:14
|
|
|
Wasserträger

Anmeldungsdatum: 02.11.2010
Beiträge: 90
Wohnort: Schkeuditz
|
|
Ich wollte in meinem neuen Spiel die Tragekapazität des Spielers beschränken und ihm dafür eine Tasche mitgeben (holdall). So weit so gut.
Ich muss nun dem Spieler an mehreren Stellen etwas programmatisch geben.
1. "now the player carries neuesDing" ignoriert die Tragekapazität völlig.
2. "now the neuesDing is in the location; try silently taking the neuesDing" führt zu unschönen Ausgaben.
3. Ich könnte jetzt noch selbst die "Hände" des Spielers prüfen und Gegenstände selbst in die Tasche verfrachten. Das erscheint mir aber recht aufwendig.
Gibt es da evtl. ein Standardlösung? |
|
|
|
 |
|
Verfasst am:
Fr, 7 Jan 2011 - 14:22
|
|
|
Experte

Anmeldungsdatum: 05.05.2004
Beiträge: 633
Wohnort: Hamburg
|
|
Folgendes könnte gehen:
...
follow the use player's holdall to avoid exceeding carrying capacity rule;
if the number of things carried by the actor is at least the carrying capacity of the actor, stop the action with library message taking action number 12 for the actor;
now the noun is carried by the player;
say "Du hast jetzt [den noun] anders genommen.";
Edit:
Oder als neue Phrase (per Edit korrigiert):
To give (O - an object) to the/-- player:
let P be the player;
follow the use player's holdall to avoid exceeding carrying capacity rule;
if the number of things carried by P is at least the carrying capacity of P, stop the action with library message taking action number 12 for P;
now O is carried by P;
say "Du hast jetzt [den O] anders genommen."
Instead of ...: give noun to player.
Zuletzt bearbeitet von ChristianB am Mo, 10 Jan 2011 - 20:20, insgesamt einmal bearbeitet |
|
|
|
 |
|
Verfasst am:
Mo, 10 Jan 2011 - 10:16
|
|
|
Wasserträger

Anmeldungsdatum: 02.11.2010
Beiträge: 90
Wohnort: Schkeuditz
|
|
Die Phrase funktioniert nicht ganz. Noun ist durch die auslegende Aktion belegt.
| Code: | Instead of opening the egg:
say "Im Ei findest du einen Ring.";
now the egg is broken;
now the ring is in the location;
give the ring to the player. |
Hierbei bekommt der Spieler z.B. das Ei (welches er schon hat) und nicht den Ring.
Ich habe das also einfach auf
| Code: | To packAway:
let P be the player;
follow the use player's holdall to avoid exceeding carrying capacity rule;
if the number of things carried by P is at least the carrying capacity of P, stop the action with library message taking action number 12 for P. |
verkürzt und das genügt völlig meinen Ansprüchen. Also Danke dafür.
| Code: | Instead of opening the egg:
say "Im Ei findest du einen Ring.";
now the egg is broken;
packaway;
now the player carries the ring. |
|
|
|
|
 |
|
Verfasst am:
Mo, 10 Jan 2011 - 10:23
|
|
|
Experte

Anmeldungsdatum: 05.05.2004
Beiträge: 633
Wohnort: Hamburg
|
|
| Es muss in meiner vorgeschlagenen Phrase natürlich nicht noun heißen, sondern O. Sonst hätte man sich das mit dem angegebenen Objekt ja auch schenken können. |
|
|
|
 |
|
Verfasst am:
Mo, 10 Jan 2011 - 12:31
|
|
|
Wasserträger

Anmeldungsdatum: 02.11.2010
Beiträge: 90
Wohnort: Schkeuditz
|
|
| Da hätte ich aber auch selbst drauf kommen können. Funktioniert. |
|
|
|
 |
|