Create 2nd Char & Switch Icon

Started by Arjunaz78, Mon 17/10/2011 17:58:49

Previous topic - Next topic

Arjunaz78

How can i create a second character and put in to other room?I mean for example i want a 2nd character to save her friend from prison,while the main character currently stuck in prison and cannot do anything..

And i want create a switch icon that player can click and then change the 2nd char as a main char. otherwise player can switch back to 1st char later..

I know i can use the;

Code: ags
cEgo.SetAsPlayer();


as the scripting code but i don't know how to put it on room scr. or global scr. besides i think i need to put another scripting code to it right?
and for the switch icon,can i create custom GUIs or i need to make it as Object?

THX.
..In the making of Silent Hill: The Hospital..

https://www.facebook.com/ArjunazGamesStudio

Khris

You'd put the switch button on a GUI.

As for the button's code:
Code: ags
  if (player == cEgo) cFriend.SetAsPlayer();
  else cEgo.SetAsPlayer();


Or the short version:
Code: ags
  character[(cEgo.ID + cFriend.ID) - player.ID].SetAsPlayer();


Keep in mind that coding a two-player character game is a good deal more complex than a standard game; if you're having trouble with stuff like this already, maybe you should improve your coding skills first.

SMF spam blocked by CleanTalk