DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • May 26, 2017, 07:48:05 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Companion AI?  (Read 8365 times)
0 Members and 1 Guest are viewing this topic.
Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« 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?
Logged
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #1 on: October 08, 2008, 06:19:03 PM »

have ye looked at any of the AI scripts that already exist?
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« Reply #2 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.
« Last Edit: October 08, 2008, 07:41:18 PM by Shenron » Logged
Iori
Mod God
*****
Offline Offline

Posts: 832


View Profile WWW
« Reply #3 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.
Logged

Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« Reply #4 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.
Logged
Iori
Mod God
*****
Offline Offline

Posts: 832


View Profile WWW
« Reply #5 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).
Logged

Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« Reply #6 on: October 08, 2008, 11:28:08 PM »

I might just ask him how he would do it then.
Logged
Iori
Mod God
*****
Offline Offline

Posts: 832


View Profile WWW
« Reply #7 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).
« Last Edit: October 09, 2008, 12:03:46 AM by Iori » Logged

Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« Reply #8 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...
Logged
Iori
Mod God
*****
Offline Offline

Posts: 832


View Profile WWW
« Reply #9 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).
« Last Edit: October 09, 2008, 12:12:39 AM by Iori » Logged

Shenron
Militia
**
Offline Offline

Posts: 9


View Profile
« Reply #10 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.
Logged
Wraith
Captain of the Guard
***
Offline Offline

Posts: 102



View Profile
« Reply #11 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?
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
29 Guests, 1 User
Zelgadiss
Home Forums News Downloads Login Register Advanced Search