Page 1 of 1

instance in script?

PostPosted: Mon Oct 27, 2003 1:34 pm
by duff
can we create an object in a script from a class of an other script?
exemple:
script1 create an object followingNPC taken in script2?

PostPosted: Mon Oct 27, 2003 8:33 pm
by Corillian
yes

PostPosted: Mon Oct 27, 2003 8:47 pm
by Smallhorse
sure you should be able to do this, why not try it? :)

PostPosted: Mon Oct 27, 2003 9:54 pm
by duff
because it bug...
scripts\cs\gameevents\wizardNPC.cs(191,5): error CS0246: Le type ou le nom d'espace de noms 'FollowingNPC' est introuvable (une directive using ou une référence d'assembly est-elle manquante_?)
scripts\cs\gameevents\wizardNPC.cs(192,5): error CS0246: Le type ou le nom d'espace de noms 'FollowingNPC' est introuvable (une directive using ou une référence d'assembly est-elle manquante_?)
scripts\cs\gameevents\wizardNPC.cs(193,17): error CS0246: Le type ou le nom d'espace de noms 'mob' est introuvable (une directive using ou une référence d'assembly est-elle manquante_?)
scripts\cs\gameevents\wizardNPC.cs(194,5): error CS0246: Le type ou le nom d'espace de noms 'mob' est introuvable (une directive using ou une référence d'assembly est-elle manquante_?)
translate :the type or the namespace with name following npc is undefines
and the line 191 to 194
FollowingNPC mob;
FollowingNPC mob = new FollowingNPC();
bool good = mob.AddToWorld();
mob.Interact(source.Player);

PostPosted: Mon Oct 27, 2003 10:46 pm
by Corillian
make sure you spelled and formatted the name correctly.

PostPosted: Tue Oct 28, 2003 10:00 am
by Smallhorse
oh no Duff, your problem is ... the FollowingNPC class is declared in the DOL.GS.GameEvents.FollowingNPCEvent.FollowingNPC

So to use the FollowingNPC you have to type

#using DOL.GS.GameEvents;
and then declare your variable

FollowingNPCEvent.FollowingNPC mob = new FollowingNPCEvent.FollowingNPC();

This should help!

PostPosted: Wed Oct 29, 2003 9:37 am
by duff
arf sorry i have found between the time of posting and the time of look the answer thanks a lot ;)