instance in script?

Discussions on various DOL development features

Moderator: Support Team

instance in script?

Postby duff » Mon Oct 27, 2003 1:34 pm

can we create an object in a script from a class of an other script?
exemple:
script1 create an object followingNPC taken in script2?
Vive DOL vive DAOC
Image
membre de MatrixTC :mappeur,codeur :) plus d info:http://www.halflifedesign.net
User avatar
duff
Inactive Staff Member
 
Posts: 1682
Joined: Fri Jun 20, 2003 5:27 pm

Postby Corillian » Mon Oct 27, 2003 8:33 pm

yes
-Corillian, Former DOL Project Lead
Corillian
Inactive Staff Member
 
Posts: 459
Joined: Sat Jun 21, 2003 1:32 am
ICQ: 35175939
Website: http://dolserver.sf.net

Postby Smallhorse » Mon Oct 27, 2003 8:47 pm

sure you should be able to do this, why not try it? :)
SmallHorse
Project Ex-Administrator with too little time to be of much use currently :)
Smallhorse
Inactive Staff Member
 
Posts: 2919
Joined: Sun Jun 22, 2003 5:54 pm
ICQ: 11718314

Postby duff » Mon Oct 27, 2003 9:54 pm

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);
Vive DOL vive DAOC
Image
membre de MatrixTC :mappeur,codeur :) plus d info:http://www.halflifedesign.net
User avatar
duff
Inactive Staff Member
 
Posts: 1682
Joined: Fri Jun 20, 2003 5:27 pm

Postby Corillian » Mon Oct 27, 2003 10:46 pm

make sure you spelled and formatted the name correctly.
-Corillian, Former DOL Project Lead
Corillian
Inactive Staff Member
 
Posts: 459
Joined: Sat Jun 21, 2003 1:32 am
ICQ: 35175939
Website: http://dolserver.sf.net

Postby Smallhorse » Tue Oct 28, 2003 10:00 am

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!
SmallHorse
Project Ex-Administrator with too little time to be of much use currently :)
Smallhorse
Inactive Staff Member
 
Posts: 2919
Joined: Sun Jun 22, 2003 5:54 pm
ICQ: 11718314

Postby duff » Wed Oct 29, 2003 9:37 am

arf sorry i have found between the time of posting and the time of look the answer thanks a lot ;)
Vive DOL vive DAOC
Image
membre de MatrixTC :mappeur,codeur :) plus d info:http://www.halflifedesign.net
User avatar
duff
Inactive Staff Member
 
Posts: 1682
Joined: Fri Jun 20, 2003 5:27 pm


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 0 guests