Some help on player character [SOLVED]

Started by CRxTRDude, Tue 07/09/2010 06:36:19

Previous topic - Next topic

CRxTRDude

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?
-------------------------------------------------------------------------------------------------
~CRxTRDUDE
Comic book artist/blogger/dude/and now game maker...

CRxTRDude

I think I just answered my question:

i made an if/then condition:

Code: ags

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


Is there no alternative code for this?
-------------------------------------------------------------------------------------------------
~CRxTRDUDE
Comic book artist/blogger/dude/and now game maker...

xerca

Quote from: CRxTRDude on Tue 07/09/2010 06:45:38
I think I just answered my question:

i made an if/then condition:

Code: ags

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.
Code: ags

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 ").

Matti

Also, the {} aren't necessary at all:

Code: ags

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

CRxTRDude

^ Nice havn't thought about that...

And sorry I replied too long
-------------------------------------------------------------------------------------------------
~CRxTRDUDE
Comic book artist/blogger/dude/and now game maker...

Khris

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:

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

CRxTRDude

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:

Code: ags
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
-------------------------------------------------------------------------------------------------
~CRxTRDUDE
Comic book artist/blogger/dude/and now game maker...

SMF spam blocked by CleanTalk