SetCreatureSize Function
#1
Posté 03 juin 2012 - 11:45
Thank you for any help you can provide.
#2
Posté 03 juin 2012 - 01:59
#3
Posté 03 juin 2012 - 02:57
Thank you for helping.
#4
Posté 03 juin 2012 - 04:53
It's in nwnx_funcs for windows, not sure about for a linux setup.
// Changes the internal size of a creature to iSize (CREATURE_SIZE_*)
// This does not change the physical size of the creature model as seen in game
void NWNXFuncs_SetCreatureSize(object oCreature, int iSize = CREATURE_SIZE_MEDIUM);
#5
Posté 03 juin 2012 - 05:41
What you mentioned about the size changing when you log would be good. I made the script to make the changes when a PC enters the module welcome area. However when the player logs and comes back, the appearance resets back to what it was before. I'm not sure how to make the appearance stay when a player logs. I tried having the on client enter script execute the subrace script, but it didn't work.
Any help would be appreciated.
Modifié par Sadira of Tyr, 03 juin 2012 - 05:43 .
#6
Posté 03 juin 2012 - 05:56
If this is true and no reason to believe its not, then try re-polymorph the character if the re-log using ActivatePortal isnt an option Sadira of Tyr.Failed.Bard wrote...
Setting a characters apperance doesn't change their size unless they log out and back in with that appearance on, which can bug other things.
#7
Posté 03 juin 2012 - 11:58
ShaDoOoW wrote...
If this is true and no reason to believe its not, then try re-polymorph the character if the re-log using ActivatePortal isnt an option Sadira of Tyr.Failed.Bard wrote...
Setting a characters apperance doesn't change their size unless they log out and back in with that appearance on, which can bug other things.
You mean having the appearance change every time the player logs on the server? I tried that, but it didn't work. I could only get it to work when entering the start area. I could post the scripts, if it will help.
#8
Posté 04 juin 2012 - 05:33
ShaDoOoW wrote...
If this is true and no reason to believe its not, then try re-polymorph the character if the re-log using ActivatePortal isnt an option Sadira of Tyr.Failed.Bard wrote...
Setting a characters apperance doesn't change their size unless they log out and back in with that appearance on, which can bug other things.
The way to do this without relogging is to change the appearance (to one with the desired size), polymorph (into anything) and unpolymorph then reset the appearance.
#9
Posté 04 juin 2012 - 06:02
void SetTinySize(object oCreature = OBJECT_SELF)
{
int nAppearance =GetAppearanceType(oCreature);
SetCreatureAppearanceType(oCreature, APPEARANCE_TYPE_BADGER);
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectPolymorph(0), oCreature, 10.0));
DelayCommand(20.0, SetCreatureAppearanceType(oCreature, nAppearance));
}
EDIT: Just realized I had used a non-standard polymorph from back when I was testing huge weapons in both shifted and unshifted forms. Polymorph number corrected to 0.
Modifié par WhiZard, 04 juin 2012 - 06:24 .
#10
Posté 04 juin 2012 - 11:42
#11
Posté 05 juin 2012 - 12:15
EXAMPLE CODE:
[i]//Item Restriction: No shields, Only large weapons
SubraceRestrictUseOfItems("Giant-Hill", ITEM_TYPE_WEAPON_SIZE_SMALL_DOWN|ITEM_TYPE_WEAPON_SIZE_MEDIUM|ITEM_TYPE_SHIELD_ANY, TIME_BOTH); [/i]sha_subr_methds:
[i]// Restricting the use of Items (both weapons and armour) for a given subrace. // Use this for each of the four TimeOfDay you want. (TIME_DAY, TIME_NIGHT, TIME_SPECIAL_APPEARANCE_NORMAL and TIME_SPECIAL_APPEARANCE_SUBRACE) // ItemType should be a mix of the following (mix them by using | ): // // --------- Weapon Restrictions --------- // // // - ITEM_TYPE_WEAPON_MELEE - Melee Weapons (incl. Monk Gloves) Does NOT include Bracers. // - ITEM_TYPE_WEAPON_RANGED_THROW - Ranged Weapons (Throwing Weapons) // - ITEM_TYPE_WEAPON_RANGED_LAUNCHER - Ranged Weapons (Launchers) Does "incl." Ammonition (Ammo can still be equipped but is not usable) // - ITEM_TYPE_WEAPON_RANGED - Ranged Weapons (Both Launchers and Throwing) // - ITEM_TYPE_WEAPON - All Weapons (Both Ranged and Melee) // // - ITEM_TYPE_WEAPON_PROF_SIMPLE - Simple Weapons // - ITEM_TYPE_WEAPON_PROF_MARTIAL - Martial Weapons // - ITEM_TYPE_WEAPON_PROF_EXOTIC - Exotic Weapons // - ITEM_TYPE_WEAPON_PROF_ANY - All Weapon Prof. // // - ITEM_TYPE_WEAPON_SIZE_TINY - Tiny Weapons // - ITEM_TYPE_WEAPON_SIZE_SMALL - Small Weapons // - ITEM_TYPE_WEAPON_SIZE_MEDIUM - Medium Weapons // - ITEM_TYPE_WEAPON_SIZE_LARGE - Large Weapons // // - ITEM_TYPE_WEAPON_SIZE_SMALL_DOWN - All Small or smaller Weapons (Small, Tiny) // - ITEM_TYPE_WEAPON_SIZE_MEDIUM_UP - All Medium or Larger Weapons (Medium, Large) // - ITEM_TYPE_WEAPON_SIZE_ANY - All Weapon Sizes. // // // // --------- Armour, Helm and Shield Restrictions --------- // // - ITEM_TYPE_SHIELD_SMALL - Small Shields // - ITEM_TYPE_SHIELD_LARGE - Large Shields // - ITEM_TYPE_SHIELD_TOWER - Tower Shields // - ITEM_TYPE_SHIELD_ANY - All Shields. // // - ITEM_TYPE_ARMOR - Torso Armour Only (AC 0-8) // - ITEM_TYPE_ARMOR_TYPE_CLOTH - Cloth Torso Armour only (AC 0) // - ITEM_TYPE_ARMOR_TYPE_LIGHT - Light Torso Armour only (AC 1-3) // - ITEM_TYPE_ARMOR_TYPE_MEDIUM - Medium Torso Armour only (AC 4-6) // - ITEM_TYPE_ARMOR_TYPE_HEAVY - Heavy Torso Armour only (AC 7-8) // // - ITEM_TYPE_ARMOR_AC_0 - Torso Armour with 0 AC // - ITEM_TYPE_ARMOR_AC_1 - Torso Armour with 1 AC // - ITEM_TYPE_ARMOR_AC_2 - Torso Armour with 2 AC // - ITEM_TYPE_ARMOR_AC_3 - Torso Armour with 3 AC // - ITEM_TYPE_ARMOR_AC_4 - Torso Armour with 4 AC // - ITEM_TYPE_ARMOR_AC_5 - Torso Armour with 5 AC // - ITEM_TYPE_ARMOR_AC_6 - Torso Armour with 6 AC // - ITEM_TYPE_ARMOR_AC_7 - Torso Armour with 7 AC // - ITEM_TYPE_ARMOR_AC_8 - Torso Armour with 8 AC // // - ITEM_TYPE_HELM - Helms // // - ITEM_TYPE_FULL_ARMOR_SET - All Armours, Shields and Helms. // // --------- Misc. Restrictions --------- // // - ITEM_TYPE_JEWLERY - Rings and Amulets // - ITEM_TYPE_MISC_CLOTHING - None-Torso clothing (Cloak, Braces, Boots) Does NOT include Jewlery // - ITEM_TYPE_NONE_BIOWARE_ITEM - ALL None Standard Bioware Items (e.g. CEP Items) // // // // TimeOfDay should either be any mix of TIME_DAY,TIME_NIGHT, TIME_BOTH for time-based restrictions OR // a mix of TIME_SPECIAL_APPEARANCE_SUBRACE, TIME_SPECIAL_APPEARANCE_SUBRACE for appearance-based restrictions. // Appearance-based will override Time-based in case of conflict! // // Allow should be a mix of the follow constants: // - ITEM_TYPE_REQ_ALL - Must meet ALL requirements (applies to Weapons-req. only) e.g. only weapons that are Large Weapons AND Simple Weapons can be used // - ITEM_TYPE_REQ_ANY - Must just meet one of the requirements e.g. Large Weapons or simple weapons can be used. // - ITEM_TYPE_REQ_DO_NOT_ALLOW - Subrace CANNOT use ItemType during TimeOfDay (input is reversed) void SubraceRestrictUseOfItems(string subrace, int ItemType, int TimeOfDay = TIME_BOTH, int Allow = ITEM_TYPE_REQ_DO_NOT_ALLOW);[/i]
Modifié par Birdman076, 05 juin 2012 - 12:17 .
#12
Posté 05 juin 2012 - 02:00
Birdman076 wrote...
If you are using Shayan's Subrace System still its very easy. Line 237 of sha_subr_methds explains how to Restrict item use based on subrace.
There is a difference between changing size and restricting items. A tiny creature gets a two-handed strength bonus for wielding a small weapon, also this creature is disallowed a shield when a small weapon is equipped (but not a tiny weapon). Additionally tiny creatures get additional bonuses to AB, AC, and stealth beyond that of a small creature.
#13
Posté 05 juin 2012 - 02:49
Modifié par Birdman076, 05 juin 2012 - 02:51 .
#14
Posté 05 juin 2012 - 09:51
The polymorph thing worked great. I could use a two handed weapon with a tower shield with an ogre or minotaur. However I could only dual weild a two handed weapon with a one handed weapon. Two great swords did not work.
We used to use the Shayan subraces, but they were removed because of too many problems, and too many resourses used. I'm trying to make new subraces that don't need a whole lot of scripts running all the time. I had made my own script for tiny creatures item restrictions, but I did not know about tiny creatures and benefits with small weapons. Thanks for the examples though. Now I can add some armour restrictions too.
#15
Posté 05 juin 2012 - 11:46
Creature has appearance A 1) Appearance is set to appearance B 2) Polymorph to appearance C 3) Appearance is set to appearance D 4) Un-polymorph 5) Appearance is set to appearance E 1 2 3 4 5 Size A C C B B Race A C C A A Speed B B D D E
Modifié par WhiZard, 05 juin 2012 - 11:47 .
#16
Posté 14 juin 2012 - 10:05
Thank you.





Retour en haut







