Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: CRxTRDude on Tue 07/09/2010 06:36:19

Title: Some help on player character [SOLVED]
Post by: CRxTRDude on Tue 07/09/2010 06:36:19
Well, I'm sorry if this is the appropriate forum but...

Well, I kind of switched to 3.2. Very hard, but I kind of liked it.

Now, for the question:

 -Well, I have two characters: cEgo and cLuna. cEgo is player character. The situation is when you look at luna, instead of luna saying that she is beautiful, Ego will say that.

How can I do that?
Title: Re: Some help on player character
Post by: CRxTRDude on Tue 07/09/2010 06:45:38
I think I just answered my question:

i made an if/then condition:


function cLuna_Look(){
   if (player.ID == cEgo.ID){
      cEgo.Say ("You're beautiful, Luna.)
   }
}


Is there no alternative code for this?
Title: Re: Some help on player character
Post by: xerca on Tue 07/09/2010 12:19:31
Quote from: CRxTRDude on Tue 07/09/2010 06:45:38
I think I just answered my question:

i made an if/then condition:


function cLuna_Look(){
   if (player.ID == cEgo.ID){
      cEgo.Say ("You're beautiful, Luna.)
   }
}


Is there no alternative code for this?
The main idea is this, yes. But you can make it a little bit more simple.

function cLuna_Look(){
   if (player == cEgo){
      cEgo.Say ("You're beautiful, Luna.")
   }
}


This will also work.. i think. I'm not sure if this reply was necessary... (by the way you were missing a ").
Title: Re: Some help on player character
Post by: Matti on Tue 07/09/2010 12:31:48
Also, the {} aren't necessary at all:


function cLuna_Look(){
  if (player == cEgo) cEgo.Say ("You're beautiful, Luna.");
}
Title: Re: Some help on player character
Post by: CRxTRDude on Mon 21/03/2011 14:13:28
^ Nice havn't thought about that...

And sorry I replied too long
Title: Re: Some help on player character
Post by: Khris on Mon 21/03/2011 14:55:34
Is it even possible to switch the playable character?
Because it seems like no and if not, I don't understand the original problem, all you'd have to do is:

function cLuna_Look(){
  cEgo.Say ("You're beautiful, Luna.");
}
Title: Re: Some help on player character
Post by: CRxTRDude on Mon 21/03/2011 15:39:07
Quote from: Khris on Mon 21/03/2011 14:55:34
Is it even possible to switch the playable character?
Because it seems like no and if not, I don't understand the original problem, all you'd have to do is:

function cLuna_Look(){
  cEgo.Say ("You're beautiful, Luna.");
}


Oh, now that you mentioned it, the game supposedly have two characters. one of which is cEgo, the other one is cNikki, each with their own storyline but same setting...

So anyways thanks for reminding.  ;D