Author Topic: Inventory - 2 charakter game  (Read 286 times)  Share 

Inventory - 2 charakter game
« on: 05 Apr 2004, 08:16 »
hi all,

sorry for my bad englisch in advance.
i try to make a game, where you can switch between two charakters.
how can i solve it easily, when 1 charakter gives an inventory item to the other one?
cause i dont no, which item and i have to remove it by the one and add it to the other.

thanks for hints
greets
rocco

Scummbuddy

  • Mittens Knight
  • Give Stylish Confetti to BoZo - Wheee!
    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
Re:Inventory - 2 charakter game
« Reply #1 on: 05 Apr 2004, 08:56 »
check out this, and aee Also: AddInventory, LoseInventory

UpdateInventory ();

Updates the player's inventory display. If you add or remove inventory items manually (ie. by using the character[].inv[] variables rather than the AddInventory/LoseInventory functions), the display may not get updated. In this case, after making your changes, call this function to update what is displayed to the player.
-----------------

you may want to use the character[script name].inv[ # ] along with the update, but you'll probably need to run a check to see which character is currently being played.


Your English is really not all that bad. Very readable, but just some spelling mistakes, but nothing too bad at all. Nicely done.
« Last Edit: 05 Apr 2004, 08:57 by Scummbuddy »
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Re:Inventory - 2 charakter game
« Reply #2 on: 05 Apr 2004, 10:49 »
thanks scummbuddy, it works  8)

in the variable:whichplayer i stored which character is controlled at the moment by the player.
so i have a runscript command for example in:
charakter-editor/syd/interactioneditor/useinventoryoncharakter/runscript

  // script for character1: Use inventory on character
character[SYD].inv[game.inv_activated ] +=1;
character[whichplayer].inv[character[whichplayer].activeinv] -=1;
UpdateInventory ();
SetActiveInventory(-1);

greets
rocco

EDIT: but the charakter dont walk to the other.
which command can achieve this?

« Last Edit: 05 Apr 2004, 11:03 by Rocco »

Scummbuddy

  • Mittens Knight
  • Give Stylish Confetti to BoZo - Wheee!
    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
Re:Inventory - 2 charakter game
« Reply #3 on: 05 Apr 2004, 16:01 »
Use this command twice, once for each character.
----------------
MoveCharacterBlocking (CHARID, int x, int y, int direct);

Moves the character CHARID to location (X,Y), waiting until they arrive there before returning to the script.
If DIRECT is 0, this acts like MoveCharacter; if it is 1 then this acts like MoveCharacterDirect.

Example:

MoveCharacterBlocking(EGO,234,122,1);

will make the character EGO walk to 234,122 ignoring walkable areas and return the control to the player when he gets there.
---------------
so, move both characters to a close enough point, then use the facecharacter command again for both, and then you should be set.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Re:Inventory - 2 charakter game
« Reply #4 on: 05 Apr 2004, 21:42 »
thx, i solved it this way:

int sydx = character[SYD].x;
int sydy = character[SYD].y;
MoveCharacterBlocking(whichplayer, sydx, sydy, 0);
FaceCharacter(whichplayer,SYD);
FaceCharacter(SYD,whichplayer);