Kyshakk Koan Oathkeeper Posted March 28, 2004 Share Posted March 28, 2004 Right, so I'm trying to learn Avernumscript... Could someone explain how I would make a creature turn neutral/ friendly after it has lost one quarter (1/4) of its life? May be stupid but I want to know how it is done. Have to start somewhere. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted March 28, 2004 Share Posted March 28, 2004 There's the set_attitude call. For the HP part, you can use get_health and get_max_health calls. To be more efficient, get_max_health once and then store it in a variable. Link to comment Share on other sites More sharing options...
Kyshakk Koan Oathkeeper Posted March 28, 2004 Author Share Posted March 28, 2004 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 More sharing options...
Ineffable Wingbolt DesertPlah Posted March 28, 2004 Share Posted March 28, 2004 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 More sharing options...
Kyshakk Koan Oathkeeper Posted March 29, 2004 Author Share Posted March 29, 2004 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 More sharing options...
Well-Actually War Trall The Creator Posted March 29, 2004 Share Posted March 29, 2004 You could give it a custom graphic with no death animation. Link to comment Share on other sites More sharing options...
Curious Artila macman0 Posted March 29, 2004 Share Posted March 29, 2004 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 More sharing options...
Kyshakk Koan Oathkeeper Posted March 29, 2004 Author Share Posted March 29, 2004 @ The Creator: True, but wouldn't that leave a gap, a flicker, or something? @ Macman0: I don't know if it would work, and I dont have the skills yet to pull anything like that off, yet. Thanks anyway. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted March 29, 2004 Share Posted March 29, 2004 Items do have the lifesaver ability that has a 5% * item strength of working. So give an item one charge and 20 strength of life saving and it will do as you want. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Spidweb Posted March 29, 2004 Share Posted March 29, 2004 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 More sharing options...
Well-Actually War Trall The Creator Posted March 29, 2004 Share Posted March 29, 2004 Put standard standing-up graphics in the death animation slots, then. Or if you want to script it and make sure it doesn't die too soon, you could just give it way more health than it really should have. Link to comment Share on other sites More sharing options...
Curious Artila macman0 Posted March 29, 2004 Share Posted March 29, 2004 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. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Eldiran Posted March 29, 2004 Share Posted March 29, 2004 Hm. Its possible that A) The function char_take_item doesn't work on monsters. 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 More sharing options...
Curious Artila macman0 Posted March 29, 2004 Share Posted March 29, 2004 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. 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 More sharing options...
Magnificent Ornk Drakefyre Posted March 30, 2004 Share Posted March 30, 2004 It should be if (char_has_item(ME,447) == 1) Link to comment Share on other sites More sharing options...
Curious Artila macman0 Posted March 30, 2004 Share Posted March 30, 2004 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 More sharing options...
Kyshakk Koan Oathkeeper Posted March 30, 2004 Author Share Posted March 30, 2004 *Looks through t9griffon.txt .* Hmm, yeah... Thanks, that helps! Next time I'll look through the scripts before I ask something stupid. Link to comment Share on other sites More sharing options...
Recommended Posts