error BrainAI

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Ispa
New User
Posts: 16
Joined: Sun Sep 20, 2009 12:30 pm

error BrainAI

Post by Ispa »

Hi Guys, ;)

i was playing with BrainAI(really i wanted to understood how it work :P)

i made a script just to mount the npc but when i doubleclick(in this case just return a sysmsg) on npc pol console says :


WARNING: pkg/mobiles/brainAI/bundled/tamed/prova.ecl: Unable to find module npc
syslog [pkg/mobiles/brainAI/brain.ecl]: NPC Template: :brainai:Mustang
syslog [pkg/mobiles/brainAI/brain.ecl]: NPC Name : a Mustang
syslog [pkg/mobiles/brainAI/brain.ecl]: Error::StartNerve() - [DblClick] [:brain
AI:bundled/tamed/prova] failed to start! ->Unable to start script
syslog [pkg/mobiles/brainAI/brain.ecl]: ------------


The Script is :


use uo;
use os;
use npc;
include ":brainAI:eventid";
include ":brainAI:npcNerves";
include ":brainAI:npcCommands";
include ":containers:storageAreas";
include ":containers:containers";
include ":gumps:gumps";
include ":attributes:attributes";
include ":attributes:include/stats";
include ":mounts:mounts";

program mercante_aicript(params)
var me := Self();
var npc := params[1];
var event := params[3];



while( npc )

if(event)
case(event.type)

SYSEVENT_DOUBLECLICKED: SendSysMessage(event.source, "Good, you doubleclicked me, it means event works", color := 35);
break;
default:
break;
endcase
event := 0;
endif
SleepMS(5);
event := Wait_For_Event(100000);
endwhile
endprogram


what could be the problem?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: error BrainAI

Post by xeon »

You're missing npc.em in "module" directory?
Ispa
New User
Posts: 16
Joined: Sun Sep 20, 2009 12:30 pm

Re: error BrainAI

Post by Ispa »

nono there is hey are you italian?
Ispa
New User
Posts: 16
Joined: Sun Sep 20, 2009 12:30 pm

Re: error BrainAI

Post by Ispa »

why this work and the other not?!!? i dont see nothing difference in the logic, do you?:




use uo;
use os;

include ":brainAI:npcNerves";
include ":brainAI:npcCommands";

program BrainNerve(params)
var npc := params[1];
//var nerve_name:= params[2];
var event := params[3];
//var settings := params[4];
//var scripts := params[5];
params := 0; // Not needed anymore.

while ( npc )
if ( event )
case ( event.type )
SYSEVENT_DOUBLECLICKED:
SendSysMessage(event.source, "ok doppioclick", color := 35);
break;
default:
break;
endcase

event := 0;
endif

SleepMS(5);
event := Wait_For_Event(900000);
endwhile
endprogram
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: error BrainAI

Post by CWO »

are you starting this script by double click or start_script? If either, you'll have this error because npc.em can't be accessed in any other way than being the AI Script of an npc. In order to start it as an AI script on an NPC, you have to assign it to the NPC then restart the script...

Code: Select all

me.script := (new AI script);
RestartScript(me);
Post Reply