Jump to content


Photo

[Help Wanted] Script for summoned creature.


  • Please log in to reply
4 replies to this topic

#1 Monty

Monty
  • Member
  • 6 posts

Posted 15 July 2011 - 10:38 PM

Posted by: Monty

Date posted:
July 16, 2011 (+8:00GMT)

Looking for:
Coder

Details:

- I'm creating/revising my first kit and I have a simple HLA that basically uses an EFF file to summon a creature to attack my enemy for one round. I would appreciate for someone to write a script that will do just with a little more on the side.
- Some of the creature's details: She's an archer, she's ethereal and uncontrollable by the PC, and she only appears when there's an enemy in sight. After one round of attacking the nearest enemy, she immediately disappears. If summoned without an enemy, she must not appear at all . If needed, the creature's ID is j#turret.cre.
- The whole concept of the ability, if it would help, is such: it is basically a rip-off of the Arkanis Gath idea. Whenever the PC is attacked for the duration of the spell, a creature is summoned in the vicinity to attack the last person to attack the PC. However, she cannot exist multiple times (ie., like Arkanis Gath multiplying if the PC did not die on his attack).
- As I don't want to have this done without learning myself, I would also like to ask if this is an efficient way of doing it: I will create two creatures wherein one is summoned by the spell, and that one summoning the archer when there are enemies attacking me. If such is the case, I would like to request for both of their scripts.

Also, a bit to the off-side: I would also like to offer my help for simple coding purposes. I have just finished a simple version of this thief kit using WeiDU and lots of NearInfinity and DLTCEP (and borrowing lots of bams and lines from Rogue Rebalancing). If anyone would be patient enough to point out to me some things I am curious or confused about (especially file editing using WeiDU), I am willing to provide proofreading and any literary research/revision for you as well as type out code for you as long as I get to know/understand what it is that those codes do. A sample of my writings, both fictional and nonfictional, can be found here. My kit's installer can be emailed on request, if ever.

Thanks in advance to anyone and everyone.

Edited by Monty, 15 July 2011 - 10:44 PM.


#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 15 July 2011 - 11:07 PM

Something like this should suffice:
IF
  OR(2)
    !See([EVILCUTOFF])
    NumCreatureGT("j#turret",1)
THEN
  RESPONSE #100
    DestroySelf()
END

IF
  See([EVILCUTOFF])
THEN
  RESPONSE #100
    AttackOneRound(LastSeenBy())
    Wait(1)
    DestroySelf()
END
Instead of the NumCreatureGT, you could just disable the use of the spell for the duration of the spell (there are several spells like this in the vanilla game, shapeshifting ones for example I think).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 Monty

Monty
  • Member
  • 6 posts

Posted 16 July 2011 - 01:09 AM

Ah, yes, it works. And I don't have to deal with two creatures. All I needed was to have the creature break its invisibility on attack and it's like she's already been checking for enemies. This is awfully simple and very clean.

Thank you very much, Miloch. I still have one further question...

Should I want an ethereal buffer who appears only when I'm hurt to heal me, then this is usable, right?

***Code deleted.***

Thank you for your patience.

EDIT: Figured it out. My code was more complicated than it should be. Will follow up with some more questions soon enough, if need be.

Edited by Monty, 16 July 2011 - 01:29 AM.


#4 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 16 July 2011 - 06:45 PM

Should I want an ethereal buffer who appears only when I'm hurt to heal me, then this is usable, right?

***Code deleted.***

Thank you for your patience.

EDIT: Figured it out. My code was more complicated than it should be.

I don't know what you came up with, but something like this should work:
IF
  Detect([PC])
  HPPercentLT(LastHeardBy(),90)
THEN
  RESPONSE #100
    ForceSpell(LastHeardBy(),CLERIC_CURE_CRITICAL_WOUNDS)
    Wait(1)
    DestroySelf()
END

IF
  OR(2)
    !Detect([PC])
    !HPPercentLT([PC],90)
THEN
  RESPONSE #100
    DestroySelf()
END
That assumes you're invoking such a CRE via spell, like in the first case.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#5 -sajid121-

-sajid121-
  • Guest

Posted 26 April 2012 - 03:58 AM

whole concept of the ability, if it would help, is such: it is basically a rip-off of the Arkanis Gath idea. Whenever the PC is attacked for the duration of the spell, a creature is summoned in the vicinity to attack the last person to attack the PC. However, she cannot exist multiple times (ie., like Arkanis Gath multiplying if the PC did not die on his attack).