NWN2 Toolset

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ga_create_obj script

 
Post new topic   Reply to topic    NWN2 Toolset Forum Index -> NWN2 Scripting Help
View previous topic :: View next topic  
Author Message
Jimi Jankins



Joined: 28 Aug 2008
Posts: 1

PostPosted: Fri Sep 05, 2008 2:29 am    Post subject: ga_create_obj script Reply with quote

Hello. I am new to scripts but have learned a bit on the web. I seem to be having trouble using the ga_create_obj script under on inventory disturbed in the properties of a placeable. I entered the variables but it does not work. It only seems to work in a conversation.

Can I use the ga_create_obj script in the (on inventory disturbed script) ?

Basically , I want a creature to spawn when the inventory is taken from a chest.
Back to top
View user's profile Send private message
Jinker



Joined: 01 Dec 2006
Posts: 24

PostPosted: Tue Apr 28, 2009 3:30 am    Post subject: Reply with quote

Code:
//Put this script OnOpen
#include "nw_i0_generic"
void main()
{

object oPC = GetLastOpenedBy();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "creature_to_spawn_resref", lTarget);

oTarget = oSpawn;

SetIsTemporaryEnemy(oPC, oTarget);

AssignCommand(oTarget, ActionAttack(oPC));

AssignCommand(oTarget, DetermineCombatRound(oPC));

}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NWN2 Toolset Forum Index -> NWN2 Scripting Help All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum





Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.

Abuse - Report Abuse
Powered by forumup.com free forum, create your free forum!
Created by Raulken of Hyarbor S.r.l.
TOS & Privacy.

Page generation time: 0.032