Changing Npc character object to another

Hello all, I am working on a game based on the 60's Batman. So far I can get the player object to pull a lever and he changes his player object to his costume object and back again. I want to be able to do the same with Robin but as an Npc. I can get the Npc to the correct location but I can't figure out how to make him either switch to the costume as an Npc or just wear the costume.
I tried using the Wear command under Npc but he just holds it. Help!


Io

You can make it a 'cosmetic' switch.

Objects come with the inbuilt attribute 'alias'. It's what you see ingame. So if you have JokerObject, with the JokerObject.alias="The Joker", then ingame you'll see it called The Joker rather than JokerObject.

You can use this to make the switch. Taking the example of Bruce Wayne. Pardon my Psuedocode:

BatmanObject.alias="Bruce Wayne"
set BatmanObject.alias="Batman"

You can even make this do more than just affect their display names. For example, what if you Look At BatmanObject? Then you can have Look At run a script, one that prints different stuff depending on what BatmanObject's alias is:

if BatmanObject.alias="Bruce Wayne":
     print "It's Bruce Wayne, the billionare. He's wearing a suit."
else if BatmanObject.alias="Batman":
      print "It's Batman, Gotham's most famous vigilante. He's wearing his signature costume."

Hope this helps!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums