Game freeze when using SetAsPlayer()

Started by Bleckman1974, Sun 20/11/2005 02:05:26

Previous topic - Next topic

Bleckman1974

Ok, I have a Hot spot,

Its a "Closet", when the character opens it, he gets an object, then when then player clicks on the hot spot again, he "changes Clothes" and the game continues.

with this code, it Gives the object, when the player clicks again the game freezes,

what is wrong with this code
if (player.InventoryQuantity[7] > 0) {
character[MANGEL].SetAsPlayer();
  return;
}
player.AddInventory(inventory[7]);
DisplayMessage(6);
return;
}


EDIT:
ok I just saw it was posted

but it Still Frezes the game

so NAAAA

BTW: That FAQ need to be UPDATED for 2.7.
Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

Ashen

1.What if you try:
Code: ags

if (player.InventoryQuantity[7] != 0) {
  character[MANGEL].SetAsPlayer();
}
else {
  player.AddInventory(inventory[7]);
  DisplayMessage(6);
}

(Although the whole thing seems odd to me, as when you change characters, the new one won't have the item anyway.)

2. What room is MANGEL in? SetAsPlayer will take the game to the new character, rather than bringing the new character to the current room. So, if MANGEL is in room -1 (for example) that might cause the problem. (Although, that's more likely to be a crash, than freezing the game.) Is MANGEL visible, on a walkable area, etc?

3.
Quotewhen then player clicks on the hot spot again, he "changes Clothes"
Then why are you using SetAsPlayer? If you want it to be the same character just looking different, try using Character.ChangeView() (and .SpeechView, .IdleView, etc, as needed).

4. Descriptive thread titles, please. And watch your attitude.


Beyond these, I'm not sure what to suggest. What exactly do you mean by 'the game freezes'? (Totally unreponsive, just doesn't change characters, crashes, etc.)
I know what you're thinking ... Don't think that.

Bleckman1974

#2
thanks i Didn't Think of that LOL


Yeah, i can't click the Interface, the character won't move.

Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

Ashen

How big is the game so far? Any chance you could upload it somewhere for us to see? Possibly just the room would do, if the whole thing is too big (or you just don't want anyone seeing your game yet).

If you've checked the things I mentioned, I can't see a reason - from what you've said - for it to freeze, but there could be something you've overlooked in another bit of code.
I know what you're thinking ... Don't think that.

Bleckman1974

#4
 I did the Change Clothes thing, it worked like a Charm!

thanks!

Once again, Ii'm ot  an idiot, I just  tend to "OVER-THINK" and make it more Envolved than what it is.
BTW, Im not even 20% done and its 9 megs wow!

Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

SMF spam blocked by CleanTalk