News   About   FAQ   Statistics   Player Options   Downloads   Gallery   Forums   Donate   Wiki   Staff   Jobs   Links   Contact Us

Go Back   Sundren Forums > Neverwinter Nights 2 > Neverwinter Nights 2 General Discussion > Neverwinter Nights 2 Scripting
Register Members List Calendar Search Today's Posts Mark Forums Read

Neverwinter Nights 2 Scripting Neverwinter Nights 2 scripting discussions.


Welcome to the Sundren Forums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2009
Product of Void's Avatar
Product of Void Product of Void is offline
Hero
 
Join Date: Sep 2008
Posts: 791
Rep Power: 117
Product of Void has a spectacular aura aboutProduct of Void has a spectacular aura about
Pov's little goobered up script

//Product of Void's model spawn with item.
Code:
 
void main(string sItems)
{
object oUsedit= GetLastSpeaker();
object oWalkforme;
location lSh;
int iType;
int iSwitche=1;
object oSM;
object oSitem;
object oStre;
//string sItems;
//iType =GetAppearanceType(oUsedit);
lSh =GetLocation(GetWaypointByTag("WP_pov_model1_01"));
 
oWalkforme =CreateObject(OBJECT_TYPE_CREATURE, "pov_mmale",lSh,FALSE, "pov_model1");
//SetCreatureAppearanceType(oWalkforme,iType);
//oSM=GetObjectByTag("pov_osm");
iType =GetLocalInt(GetObjectByTag("pov_osm"), "iHasiem");
SetCreatureAppearanceType(oWalkforme,(GetAppearanceType(oUsedit)));
//putting item on critter
 
//sItems=GetLocalString(oSM, "sStore");
oStre=GetObjectByTag(sItems);
//sItems=GetLocalString(oSM, "sItmz");
oSM=GetFirstItemInInventory(oStre);
while(GetIsObjectValid(oSM))
{
if (iSwitche== iType)
{
CopyItem(oSM,oUsedit);
CopyItem(oSM,oWalkforme);
oUsedit=GetFirstItemInInventory(oWalkforme);
AssignCommand(oWalkforme, ActionEquipItem(oUsedit, INVENTORY_SLOT_CHEST));
//AssignCommand(oWalkforme, ActionEquipMostEffectiveArmor());
return;
}
oSM= GetNextItemInInventory(oStre);
 
iSwitche++;
}
//oSitem= GetItemPossessedBy(oStre,sItems);
//oUsedit =
//CopyItem(oSitem,oUsedit);
 
//CopyItem(oSitem,oWalkforme);
AssignCommand(oWalkforme, ActionEquipMostEffectiveArmor());
 
}
****************************DOesn't equip******************
//Product of Void's model spawn with item.


Code:
 
 
void main()
{
object oUsedit= GetLastSpeaker();
object oWalkforme, oSM, oStre;
location lSh;
int iType, iSwitche;
string sStore;
 
//find waypoint to spawn fashion model
lSh =GetLocation(GetWaypointByTag("WP_pov_model1_01"));
 
//aquire name of store to get stuff from
sStore=GetLocalString(GetObjectByTag("pov_osm"), "sItmz");
SendMessageToPC(oUsedit, sStore);
//get the gender of the model
iType = GetLocalInt(GetObjectByTag("pov_osm"), "iGender");
//get the race
iSwitche=GetLocalInt(GetObjectByTag("pov_osm"), "iRace");
//if they did not change the race/gender go with theirs
if(iType==0 && iSwitche==0) {
iType =GetGender(oUsedit);
iSwitche=GetAppearanceType(oUsedit);
}
//actual selecting of male or female models
sStore="pov_mmale";
if(iType >=1)sStore= "pov_fmale";
//make the critter
oWalkforme =CreateObject(OBJECT_TYPE_CREATURE, sStore,lSh,FALSE, "pov_model1");
//change how it looks 
SetCreatureAppearanceType(oWalkforme,iSwitche);
//give it a heartbeat so it will walk the waypoints hopefully.
SetEventHandler(oWalkforme,CREATURE_SCRIPT_ON_HEARTBEAT, "nw_c2_default1");
SetEventHandler(oWalkforme,CREATURE_SCRIPT_ON_SPAWN_IN, "nw_c2_default9");
//start setting up the while function
oStre=GetObjectByTag(sStore);
oSM=GetFirstItemInInventory(oStre);
//number in the invenotry of armor to copy. 
iType =GetLocalInt(GetObjectByTag("pov_osm"), "iHasiem");
iSwitche=1;
 
while(GetIsObjectValid(oSM))
{
if (iSwitche== iType)
{
SendMessageToPC(oUsedit, "found it");
CopyItem(oSM,oWalkforme);
oUsedit=GetFirstItemInInventory(oWalkforme);
AssignCommand(oWalkforme, ActionEquipItem(oUsedit, INVENTORY_SLOT_CHEST));
DelayCommand(120.0 ,DestroyObject(oWalkforme));
return;
}
oSM= GetNextItemInInventory(oStre);
SendMessageToPC(oUsedit, "in loop");
 
iSwitche++;
}
//end of function
}
This is a second script of a two script task that works within a converstation.

This one draws the variables creates a creature, creates item on creature, and makes them equip.

It DID work...but I broke it good.

its an older version of the script but perhaps someone will tell me WHERE I goobered it up.
__________________
blame everything right in my life on god -Me.
Being insane in a sane world is alot more fun then being a sane man in an insane world. -Me
I am only what you percieve, and even that is an illusion. -Me.

Ashinet Clavin Shiv Shadowsong

Last edited by Product of Void; 02-09-2009 at 06:09 PM.
Reply With Quote
  #2  
Old 02-09-2009
c2k c2k is offline
Nobility
 
Join Date: Jun 2008
Posts: 139
Rep Power: 116
c2k will become famous soon enough
I don't have time for an in-depth look right now, but if this line is in the compiler exactly like this:

Quote:
SetCreatureAppearanceType(oWalkforme,(GetAppearanc eType(oUsedit)));
That could be your problem.
Reply With Quote
  #3  
Old 02-09-2009
Saulus's Avatar
Saulus Saulus is offline
Developer
 
Join Date: Sep 2006
Location: Waterloo, Ontario
Posts: 7,225
Rep Power: 50
Saulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond reputeSaulus has a reputation beyond repute
I would use the code tags on the forum to make that more legible.

Code:
blah
Reply With Quote
  #4  
Old 02-09-2009
Product of Void's Avatar
Product of Void Product of Void is offline
Hero
 
Join Date: Sep 2008
Posts: 791
Rep Power: 117
Product of Void has a spectacular aura aboutProduct of Void has a spectacular aura about
nope. I removed that. I believe it was beer four when I tried it without changing their apperance instead spawning a criter for each race (uber pain and "the suck").

I think I will re-write the whole function and converstation again and try it on another NPC.

Plus when I get home will post both functions.

I know setting the apperance on a PC works just not sure if it allows seeing armor or not will refresh memory.
__________________
blame everything right in my life on god -Me.
Being insane in a sane world is alot more fun then being a sane man in an insane world. -Me
I am only what you percieve, and even that is an illusion. -Me.

Ashinet Clavin Shiv Shadowsong
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Sundren - Archive - Top  
All times are GMT -4. The time now is 09:15 AM.
Sundren.org Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
All content of this website is property of its respective owners: Webmaster