Jump to content


Can you change the colour of a NPC or player mid game?


  • Please log in to reply
9 replies to this topic
Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 05 September 2013 - 07:22 AM #1 Can you change the colour of a NPC or player mid game?

I was planning on making a potion that has a rather interesting scen script state. But I was wondering if anyone has figured out a clever way to change the colour of the player or NPC for that matter?

Such as: (Drinks radioactive potion) "Oh look! I'm glowing green!"

Has anyone conquered such a feat?

Kelandon Kelandon

!!!

  • Global Moderator
    • Member ID: 2,682
  • 9,786 posts

Posted 05 September 2013 - 09:20 AM #2 Can you change the colour of a NPC or player mid game?

For an NPC, it's easy. Just delete the old character and put in a new, color-shifted character in the same spot with the same characteristics.

For a player, it's a little harder. I tried to replace the default character graphics (without modifying the core files) in Lord Putidus, but it only worked on Macs. Basically, you have a custom graphic with the same number as the character's graphic, and upon reload, your custom graphic gets used instead of the core graphic. It doesn't really work right.
VCH: I believe we settled this way back when: Kelandon was the most attractive.
SoT: You'd be happy, too, if you were such a clever spider.
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 05 September 2013 - 06:38 PM #3 Can you change the colour of a NPC or player mid game?

Hmm, thanks, but that wasn't what I was hoping for.

Perhaps I'll just need to give up on the colour changing idea, and work on the actual effect.

Is there something similar to it_special_class but for creatures?
For example, I'm trying to create a customised potion, that when drunk, it will hypothetically produce an effect (like a pheromone or something) that makes these big bad ugly Fungus decide to be your friend instead of your enemy.
I know it's possible to do it with at least one specific type of creature by giving it a creature script, perhaps make the player get an enlightened status, and that has an effect on how the creature script acts. But I couldn't do this for more than one type of creature.
I was hoping to have one type of potion for one species, and another for a different species.
Do you think this could be achieved?

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 05 September 2013 - 07:01 PM #4 Can you change the colour of a NPC or player mid game?

Species is the nearest thing to Special Class for creatures, but it is composed of fairly broad categories.
If the only Slime/Plant creatures in town are the only type of creature that you want to affect then it may be useful.

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 05 September 2013 - 07:03 PM #5 Can you change the colour of a NPC or player mid game?

Thanks, I might have to go with that then.

Jerakeen Jerakeen

Runcible Pastrytarian

  • Global Moderator
    • Member ID: 5,477
  • 2,519 posts
  • LocationThree Sheets to the Wind house, in Sinshan

Posted 05 September 2013 - 08:52 PM #6 Can you change the colour of a NPC or player mid game?

Not done with Citadel yet, are you?

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 05 September 2013 - 09:58 PM #7 Can you change the colour of a NPC or player mid game?

Just emailed you ;)

Kelandon Kelandon

!!!

  • Global Moderator
    • Member ID: 2,682
  • 9,786 posts

Posted 06 September 2013 - 07:47 AM #8 Can you change the colour of a NPC or player mid game?

View PostVox, on 05 September 2013 - 06:38 PM, said:

For example, I'm trying to create a customised potion, that when drunk, it will hypothetically produce an effect (like a pheromone or something) that makes these big bad ugly Fungus decide to be your friend instead of your enemy.
I know it's possible to do it with at least one specific type of creature by giving it a creature script, perhaps make the player get an enlightened status, and that has an effect on how the creature script acts. But I couldn't do this for more than one type of creature.
I was hoping to have one type of potion for one species, and another for a different species.
Do you think this could be achieved?
This is also easy. You can give any creature a special script, not just specific types. Heck, if you want it to affect every creature in the game, just edit the effect into basicnpc.

Alternatively, do it ASR-style, and have it based on SDFs and town entry (in the INIT_STATE). Or you could even do it one-by-one with placed rectangles.

But just use set_attitude() with whatever trigger you want, really.
VCH: I believe we settled this way back when: Kelandon was the most attractive.
SoT: You'd be happy, too, if you were such a clever spider.
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 06 September 2013 - 08:55 AM #9 Can you change the colour of a NPC or player mid game?

View Postξ, on 06 September 2013 - 07:47 AM, said:

This is also easy. You can give any creature a special script, not just specific types. Heck, if you want it to affect every creature in the game, just edit the effect into basicnpc.

Alternatively, do it ASR-style, and have it based on SDFs and town entry (in the INIT_STATE). Or you could even do it one-by-one with placed rectangles.

But just use set_attitude() with whatever trigger you want, really.

I understand, but Scripting is not my strong point. Have a look at my site and you might get a slight idea with what i'm trying to do for my new scenario.

Let me give you an actual example that I plan on using:
for example, I have a blue fungus monster, and a red fungus monster. Supposedly when you drink a red potion, made from red fungus spores, you will emit an odour that acts like a pheromone and the red fungus decide to be friendly. So I use set_attitude(), but how can I somehow make it known that only the red potion will affect the red fungus, and not the blue also? since they might occur in the same town in the same battle.

Is it possible that when a potion is drunk and a state is called, it will know to only affect a creature with a specific script? and not the other creatures who will also get affected by an alternative method?

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 06 September 2013 - 09:00 AM #10 Can you change the colour of a NPC or player mid game?

Hmm I just had a thought. Could it be possible to have a creature script that would have something like:
if (get_flag(0,1) == 1)
set_attitude();

and when you drink the a potion:
set_flag(0,1,1);

Would that technically work?
The only problem remaining is that I would need to set a timer that would reset the flag to 0 after a certain number of ticks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users