Graphics, Characters, Text & Rooms: Difference between revisions
Jump to navigation
Jump to search
Graphics, Characters, Text & Rooms (view source)
Revision as of 01:36, 1 December 2005
, 1 December 2005→Having multiple characters in your game
Line 164: | Line 164: | ||
==Having multiple characters in your game== | ==Having multiple characters in your game== | ||
''I want to have multiple characters in my game that the player can play as. Is this possible? And if so, how would I go about doing such a thing?'' | |||
It is indeed possible and quite easily so. If you do not have a decent grasp on scripting in AGS, then please follow a few tutorials now, as this feature requires scripting. | |||
First off, in order to switch from one character to another, simply use the '''SetPlayerCharacter()''' ('''cEgo.SetAsPlayer()''' for AGS V2.7 or above) script command. Since AGS allows every character to have his or her (or its) own separate inventory, you will be able to access this new player character's inventory as you normally would with any other. | |||
If you want to detect which character is the player character (for certain character-specific interactions or reactions), simply use an "'''if'''" command block, like so: | |||
'''For AGS V2.62 and below:''' | |||
if (GetPlayerCharacter()==ROGER) { | |||
Display("Roger, you idiot, that's a couch!"); | |||
} else if (GetPlayerCharacter()==IDIOT) { | |||
Display("That's a...uh...buffalo. Yeah...! That's the ticket!"); | |||
} else { | |||
Display("That's a couch."); | |||
} | |||
'''For AGS V2.7 or above:''' | |||
if (player==cRoger) { | |||
Display("Roger, you idiot, that's a couch!"); | |||
} else if (player==cIdiot) { | |||
Display("That's a...uh...buffalo. Yeah...! That's the ticket!"); | |||
} else { | |||
Display("That's a couch."); | |||
} | |||
Yessiree, that's all there is to it. Just search for one of the aforementioned script commands in the AGS manual and look at the related script commands it shows. | |||
==World map feature (with hidden locations) in your game== | ==World map feature (with hidden locations) in your game== | ||
==White lines around character sprites== | ==White lines around character sprites== |