Jump to content

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


Vox

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...