Inventory - 2 charakter game

Started by Rocco, Mon 05/04/2004 08:16:01

Previous topic - Next topic

Rocco

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

#1
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.
- 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

Rocco

#2
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?


Scummbuddy

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

Rocco

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);

SMF spam blocked by CleanTalk