Creature Script Problem
Author | Topic: Creature Script Problem |
---|---|
Infiltrator
Member # 5576
|
written Friday, January 13 2006 20:50
Profile
Homepage
I have been working on trying to make a creature use an item when it begins to fight. The creature's definition causes it to start with the item, and I have verified that it does have the item. However, it just won't use it. I have even tried making its species human temporarily, in case that was the problem, but it made no difference. Here is the relevant code snippet from the creature script: Once the creature sees the party, it begins to print '888', so I know that it knows it has an item, but it continues to print it after several turns, and the use of a scroll of Arcane Blow is very noticeable. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
The Establishment
Member # 6
|
written Friday, January 13 2006 21:11
Profile
Rather than putting the code to prefer item use in an attack state, just have it be at the beginning of the START_STATE. See if that works. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Infiltrator
Member # 5576
|
written Friday, January 13 2006 21:19
Profile
Homepage
First of all, I don't want the creature to just fire off its scroll or whatever the first turn after it is inited. Second, I don't see what that will change, because do_attack_tactic(3) is being called, both when the creature transitions from the START_STATE to the attack state, and repeatedly in the attack state, the creature just chooses to do something other than using the item. Third, I just tried it and it didn't work. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
The Establishment
Member # 6
|
written Friday, January 13 2006 21:25
Profile
Perhaps that do_attack_tactic() is broken? I haven't used it extensively, but I have not noticed much effect toward items with it. Your other option is to simulate using an item with scripting. Not as realistic, but plausible. [ Friday, January 13, 2006 21:26: Message edited by: *i ] -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Friday, January 13 2006 21:38
Profile
Homepage
I couldn't get do_attack_tactic(3) to do anything in the experiments I just ran. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
The Establishment
Member # 6
|
written Saturday, January 14 2006 06:55
Profile
I would say add it to the list of bugs. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Infiltrator
Member # 5576
|
written Saturday, January 14 2006 08:27
Profile
Homepage
Well, dang. I guess I'll think of something else. I can simulate two out of the three effects that I wanted, and I guess I'll just not have the third. The other settings for do_attack_tactic() certainly work; I have used those a great deal without difficulty. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
The Establishment
Member # 6
|
written Saturday, January 14 2006 09:02
Profile
What are the things you want to do, perhaps we can help? -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Infiltrator
Member # 5576
|
written Saturday, January 14 2006 11:28
Profile
Homepage
I wanted to make the effect of a candle, so that it would appear that the creature was glowing. I can't think of any other way to do that than a light emitting item. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
The Establishment
Member # 6
|
written Saturday, January 14 2006 11:38
Profile
They couldn't use light sources anyway. I'm afraid that would not be possible even using the item. A possible solution to the glowing thing could be to make a separate monster and swap the two when the item is used. Store the HP and such in a variable or something. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Infiltrator
Member # 5576
|
written Saturday, January 14 2006 12:42
Profile
Homepage
I wasn't aware of that, since I know that they could in A2. I can do without it though. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Off With Their Heads
Member # 4045
|
written Saturday, January 14 2006 12:49
Profile
Homepage
Er, I remember a lot of monsters picking up light sources in A2, but not using them. Are you sure? -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Infiltrator
Member # 5576
|
written Saturday, January 14 2006 13:25
Profile
Homepage
Yes, I'm sure that I once located and killed a gaurdian because it used a candle. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Councilor
Member # 6600
|
written Saturday, January 14 2006 18:34
Profile
Homepage
I've never seen any NPC use a light source. I've seen the guardian (or black shade) in A2 who always picks up that candle. Every time. Sometimes it darts around the table and picks up the other one. Stupid monster. A custom graphic with the monster outlined in a light color could give the effect that it was glowing. The slith avatar and Garzahd in A2 are examples. It might not be exactly what you are looking for but it can be effective. Dikiyoba. Posts: 4346 | Registered: Friday, December 23 2005 08:00 |
Agent
Member # 2820
|
written Saturday, January 14 2006 20:12
Profile
The use of items like scrolls, potions, and wands feels pretty random to me. They are often used at the most inappropriate times; for instance, a healing potion at full health. But if it stays alive for a couple of turns, and is of a species capable of using items, it will probably use it. From experience, it just seems that wands will be used most often. -------------------- Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are. ==== Alorael: War and violence would end if we all had each other's babies! ==== Drakefyre: Those are hideous mangos. Posts: 1415 | Registered: Thursday, March 27 2003 08:00 |
Councilor
Member # 6600
|
written Saturday, January 14 2006 20:34
Profile
Homepage
Somehow, the giant chiefs always know when to drink their invincibility potions. And Dikiyoba isn't complaining when the monster chugs a healing potion at full health. It's sad that Dikiyoba's party won't get it as a reward after killing the monster, but at least the monster won't be able to use it when two-thirds of its health is gone and won't be able to restore its health. Posts: 4346 | Registered: Friday, December 23 2005 08:00 |