DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => AI Scripts (v 1.1.1 only) => Topic started by: Shenron on October 08, 2008, 03:36:43 PM



Title: Companion AI?
Post by: Shenron on October 08, 2008, 03:36:43 PM
Hi, I was just wondering is there is a way to use AI Scripts with companions.
What I actually wish to do is create a companion which runs a script that keeps track of how many rounds it as been active, and once it reaches a certain number of rounds it removes the companion.
So I want to do something like with buffs, have it run out after so many rounds.

Any ideas?


Title: Re: Companion AI?
Post by: Elessa on October 08, 2008, 06:19:03 PM
have ye looked at any of the AI scripts (http://dragonprime.net/index.php?board=52.0) that already exist?


Title: Re: Companion AI?
Post by: Shenron on October 08, 2008, 06:20:25 PM
Yeah, I'll have a closer look, but none seemed to do what I want.
However I may have missed something.

Edit: Looked through at each and still nothing for what I want.


Title: Re: Companion AI?
Post by: Iori on October 08, 2008, 10:48:12 PM
You do not need a script for this.

Simply set the companion to have x hitpoints, set its type to magic, set it to cannotbehealed and set the value for "magic" as x divided by the number of rounds you would like it to last. Each round, its hp will subtract by the value of its "magic".

The downside to this is that the companion must be "magic" type (cannot be "defend", "fight" or "heal"). If you want actual A.I. scripts for companions, you would need to edit lib/extended-battle.php in a few places.


Title: Re: Companion AI?
Post by: Shenron on October 08, 2008, 10:51:16 PM
hmm... I need them to be Defend type.
I'm actually doing somthing for nightborn and he said I could do it with an AI script, so I think he knows how but wants me to figure how to do it myself.


Title: Re: Companion AI?
Post by: Iori on October 08, 2008, 11:26:49 PM
If you don't mind heavier load, just use a hook such as "battle", in conjunction with a buff (for keeping track of rounds passed, since they tick by themselves). Remove the companion on the battle hook, if a certain number of rounds have passed since they were summoned (by checking the buff).


Title: Re: Companion AI?
Post by: Shenron on October 08, 2008, 11:28:08 PM
I might just ask him how he would do it then.


Title: Re: Companion AI?
Post by: Iori on October 09, 2008, 12:01:54 AM
Is this for a specific event battle with custom creatures?

In that case, by all means, use a creature a.i. script (since it activates once every round the creature attacks and is not dead), but if you want the companion to work everywhere (e.g. forest) this way, you cannot use creature a.i. scripts (for obvious reasons).


Title: Re: Companion AI?
Post by: Shenron on October 09, 2008, 12:04:11 AM
That's what I keep thinking, but this is meant to be another thing to stop hooking into the battle system.
Basically I want to make a Companion in a specialty like in Dark Arts, but only want it to last a certain number of rounds...


Title: Re: Companion AI?
Post by: Iori on October 09, 2008, 12:10:59 AM
Frankly, if you want no hooking to in-battle hooks (e.g. if you want something like companion scripts), you would need to edit the core. There is no way to avoid hooking onto heavy-load hooks to do what you want officially. (Okay, there is, but is rather hacky, and involves using the "creatureencounter" hook and appending (.=) to creatureaiscript, and would be rather unreliable).


Title: Re: Companion AI?
Post by: Shenron on October 09, 2008, 12:14:24 AM
Yeah, he said he could just do it that way but it would take longer so he told me to write a script to do it...
But I'm not getting anywhere so I'll ask his thoughts we he is around.


Title: Re: Companion AI?
Post by: Wraith on June 09, 2015, 07:02:32 PM
I've just simulated a companion or companions with a buff when I've wanted to do this. One can even use multiple buffs for compounded effect and they don't all have to have displayed names listed. It's a text-based game and buffs are round-based. It's seemed what they're for, simplest, least demanding, and to do just that, end after a number of rounds. Are they needed to be removed by either damage OR rounds?

© 2017 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines