DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • May 18, 2013, 03:09:13 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: 1 [2] 3 4 5   Go Down
  Print  
Author Topic: Creatures with A.I.  (Read 24040 times)
0 Members and 1 Guest are viewing this topic.
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #15 on: February 19, 2007, 04:41:39 AM »

Success! Although I made bats.php instead, and gave it to all bat-type enemies (13 or 14 of them, I think...). Grin

So, the ai/ directory is required for this to work? The only other difference is that I was using include instead of require, and if I understand correctly those are only different in how they handle errors - so if there are no errors, it shouldn't matter.
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #16 on: February 19, 2007, 04:57:43 AM »

include will not give a warning, if there is an error, while require will give a real error that forces to script execution to stop.

no, the directory is not required... But it's nicer to organize the scripts in such a way... You could have taken any directory... Smiley
Logged

Running for more than three years now:
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #17 on: February 19, 2007, 07:34:20 AM »

*blinks* Well, that's odd. Maybe I did have an error in my first script... that I couldn't find by going over it line-by-line four or five times... ack.

Anyway, about scripting enemies to apply buffs (to the player, of course)... is it possible?
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #18 on: February 19, 2007, 07:49:09 AM »

Yes, maybe you need to add a global $session; and a require_once("lib/buffs.php");

Or you buff setup was broken? You could post the script, you are trying, here...
Logged

Running for more than three years now:
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #19 on: February 19, 2007, 08:59:15 AM »

Here's one attempt:

Code:
global $badguy, $session;

if ($badguy['creaturehealth'] <= 100) {
require("lib/buffs.php");
apply_buff('critter', array(
"name"=>"Banshee Wail",
"rounds"=>3,
"startmsg"=>"The wail of the banshee strikes terror into your heart!",
"dmgmod"=>0.95,
)
)
}

When I encounter it (five of them, actually):

Code:
Parse error: parse error, unexpected '}' in .../lib/extended-battle.php(481) : eval()'d code on line 12

Three times at the top of the screen (one for each that can attack, I assume).
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #20 on: February 19, 2007, 09:40:28 PM »

* XChrisX show the Evil Grin Of The Missing Semicolon.

on the line before "}" you have ")" where you should have ");" instead...
Logged

Running for more than three years now:
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #21 on: February 20, 2007, 01:48:36 AM »

*falls over* Nooooo... one day, Missing Semicolon, one day! The sad thing is, I looked at that line before and wondered why it seemed strange... Embarrassed
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5427



View Profile WWW
« Reply #22 on: February 20, 2007, 08:27:13 AM »

*falls over* Nooooo... one day, Missing Semicolon, one day! The sad thing is, I looked at that line before and wondered why it seemed strange... Embarrassed

One day, Grasshopper, when ye can snatch the semicolon from the open hand...
Logged

Play the latest beta version here on DragonPrime
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #23 on: April 04, 2007, 04:20:38 AM »

As I believe this to be by far the most significant feature added to LotGD in ages (possibly ever), I have been thinking about it a lot, and now have some other questions....

1 - Are there currently any monsters on DP LotGD using A.I. scripts?

2 - Is there a particular reason for the scripts to be run at the end of the round?

3 - Would it be possible to allow scripts to run e.g. at the beginning of the round (if desired), or when the enemy dies?

4 - Will there be a place on DP to share A.I. scripts and ideas?

Just some things that have been on my mind recently. Smiley
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #24 on: April 04, 2007, 04:41:10 AM »

1. Talisman? I know, that on lotgd.de there are about 5 monsters using A.I.

2. Seemed logical to me.

3. Yes, but... Thes would require an extra field - for each script. Possibly it would be better to re-work the whole battle script to become object oriented... This might solve some problems here... If I knew how. Tongue

4. Talisman? Wink
Logged

Running for more than three years now:
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5427



View Profile WWW
« Reply #25 on: April 04, 2007, 08:15:53 AM »

1. Talisman? I know, that on lotgd.de there are about 5 monsters using A.I.

No, there are none at the moment - this was primarily to avoid introducing potentially bugged code while testing the core.  Nor do I have any ready or the time to create any, but will certainly consider implementing any that are submitted to me for that purpose.  (I also didn't want to further aggravate players fighting through the multiple opponents!)

Quote
4. Talisman? Wink

You're saying that a lot, lately.   Wink

The only place for sharing AI scripts at the moment is under completed modules.  I'm not sure if I'll change that or not, considering how few mounts and drinks (none) have been posted up for sharing...I'm not sure that we'll see enough AI activity to support it's own board.  We'll see.

It's possible that I could add a section for discussing and sharing mounts, drinks, companions and AI.
Logged

Play the latest beta version here on DragonPrime
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #26 on: April 04, 2007, 09:11:37 PM »

it may be that we havent seen any because there is no place to share!
Logged

ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 368


Dying is the easy part.


View Profile
« Reply #27 on: April 05, 2007, 01:01:43 AM »

2. Seemed logical to me.

It did to me as well, until I tried implementing a few of my ideas. For example, a buff created by the script won't take effect until the next round.

3. Yes, but... Thes would require an extra field - for each script. Possibly it would be better to re-work the whole battle script to become object oriented... This might solve some problems here... If I knew how. Tongue

Sounds kind of... difficult. I wonder if it would be worth the effort? I mean, would the benefits extend to other areas as well?

Nor do I have any ready or the time to create any, but will certainly consider implementing any that are submitted to me for that purpose.  (I also didn't want to further aggravate players fighting through the multiple opponents!)

It's a fairly flexible system... the A.I. scripts needn't be malicious in nature. The ones I've done so far tend to be, yes... Grin The effects could easily be inverted, though.

I'm not sure if I'll change that or not, considering how few mounts and drinks (none) have been posted up for sharing...I'm not sure that we'll see enough AI activity to support it's own board.  We'll see.

It's possible that I could add a section for discussing and sharing mounts, drinks, companions and AI.

It never even occurred to me to submit that sort of code before.
Logged

"I'm no hand at casuistry, but I can't break my word to a modern pessimist. It's like breaking one's word to a child." ~ The Man Who Was Thursday, G. K. Chesterton
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3592


short, sweet and to the point


View Profile WWW
« Reply #28 on: April 05, 2007, 08:30:31 AM »

I'm not sure if I'll change that or not, considering how few mounts and drinks (none) have been posted up for sharing...I'm not sure that we'll see enough AI activity to support it's own board.  We'll see.

It's possible that I could add a section for discussing and sharing mounts, drinks, companions and AI.

It never even occurred to me to submit that sort of code before.

there have been a few newbie admins who have asked for mount suggestions in the past when they realise there are only three which come stock.  they haven't a clue how to code new ones even after reading the mount FAQ.  they will have played on a server that has a mount that they would like to have. 

not that i am advocating code be posted for all mounts, as they are part of what makes a server unique. but, if someone has an interesting mount they would like to share, it would be a place where the code could be posted.

same with the AI. since it is such a new feature, it might help if there were some options posted for admins to play around with.
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Flavius
Guest
« Reply #29 on: April 05, 2007, 08:50:14 AM »

I'm not totally sure if these sorts of things would work, but if you could have a creature that only appears in MO, you could do all sorts of interesting things with the AI script. The one problem is that you might want to give an AI a "point" value. But, for example you could have a creature called "Shield of the Ages" that can't attack, but heals another creature of all damage done to it so that you need to kill the shield before you can attack the other creature. Or maybe a creature that heals all its allies, etc. etc.
Logged
Pages: 1 [2] 3 4 5   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
23 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search