Jump to content

Scripting Question- Neutralize at 1/4


Recommended Posts

I figured that much, yeah, but I didn't get it to work... Oh well, thanks anyway Drakey, I'll keep experimenting.

 

EDIT: Ok, so it works. Well, works as in worked twice, didn't work the rest of the {insert large number here} times I tried it. Howcome, when I ask it to divide (using an if statment and the current health call before) x with 4 (x being the max health) that it only turns neutral when the health is 0 (or at least, when the health bar is fully red.) ?

Furthermore, can I prevent the monster from being killed? Like stoping the party member, friendly npc, whatever from reducing the monsters health to negativ?

Link to comment
Share on other sites

You could do it so that it creates a new monster when it dies, an encounter perhaps to add talk. And you could clean up any blood or mess left.

 

Of course, I'm thinking in BoE terms, because…*sniff*…I use a PC. Anyway, that's the simple way to do it. You'd have to lower it's max health, though.

 

EDIT: Well, if it's one monster, it ought to be easy, just by using a constant for the health. If it's multiple types, however, that would require a more complex system, like the one you're talking about.

Link to comment
Share on other sites

Quote:
Originally written by Desert Plah:
You could do it so that it creates a new monster when it dies, an encounter perhaps to add talk. And you could clean up any blood or mess left.

Of course, I'm thinking in BoE terms, because…*sniff*…I use a PC. Anyway, that's the simple way to do it. You'd have to lower it's max health, though.
Wouldn't that play the death animation, so it woulf fall/evaporate/dissolve/whatever one second and the next it would be standing/alt. laying (using alt. graphics).
Link to comment
Share on other sites

Well I STILL haven't taken the time to read all of the scripting info so this may be a really dumb idea, but... What if you made an item that "saves life" 100% of the time. You give the item to the character. Then, when you want the thing to die, just use some scripting magic to take it away.

 

*Shrugs* Just a thought, nothing more.

Link to comment
Share on other sites

Look at the script t9griffon.txt in Diplomacy of the Dead. I think this is along the lines of what you're looking for.

 

The main risk is that the party will do so much damage in a round that the monster will die before it gets a chance to become friendly. If you really, really want this creature to live, you might want to have scripts watch for the creature being killed and respawn it if it dies before it has a chance to become friendly.

Link to comment
Share on other sites

I've been testing my ideas here (I need the script practice) and I have the life saving item working... most of the time. And the turn friendly script working... pretty much all of the time. But I can't get the command to remove the object to work. It keeps saying "Peculiar Error. Undefined Function." Or something like that anyway.

 

if (char_has_item(ME,447))

char_take_item(ME,447);

 

What am I doing wrong in the above statement. The item exists, and the character DOES have it. If I just put a little print statement after the if line it goes through just fine and prints the line for me. So I think it's the char_take_item command. I just don't see what's wrong. confused

Link to comment
Share on other sites

Hm. Its possible that

 

A) The function char_take_item doesn't work on monsters.

 

B) ME doesn't work with char_take_item.

 

C) Something else is wrong.

 

If neither of the top two (which I am unable to test, as BoA hasn't arrived yet) is true, then I haven't the slightest as to what's wrong.

Link to comment
Share on other sites

Well... It's not the "ME" that won't work. Either way though, it seems to be a moot point. The 100% life saving objects only seem to work about 85% of the time so. So... good luck whoever needed help. I tried. :p

This "Peculiar Error. Undefined Function Called." thing really bugs me though. I can't find that error listed anywhere. So it really is a bit... peculiar.

Link to comment
Share on other sites

It doesn't make a difference either way it would seem. I still get the same error. It is in the char_give_item / char_take_item calls. At least I think so. The if statement works fine. I put a little print call right after it to test if it does actually work, and that's not the problem.

 

if (char_has_item(my_number(),447) == 1) {

@@@@@print_str("Yep");

@@@@@print_big_str("I am ",my_number()," !");

@@@@@char_take_item(my_number(),447);

@@@@@}

 

(@ characters to fill in space)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...