Page 1 of 1

error BrainAI

Posted: Mon Nov 09, 2009 3:57 am
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?

Re: error BrainAI

Posted: Mon Nov 09, 2009 5:29 am
by xeon
You're missing npc.em in "module" directory?

Re: error BrainAI

Posted: Mon Nov 09, 2009 8:30 am
by Ispa
nono there is hey are you italian?

Re: error BrainAI

Posted: Mon Nov 09, 2009 8:33 am
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

Re: error BrainAI

Posted: Tue Nov 10, 2009 9:30 am
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);