logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Wingtail_demo.mod [Wingery]

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Jantima



Joined: 11 Feb 2005
Posts: 6
Location: Italy

PostPosted: Fri Feb 11, 2005 10:00    Post subject: Wingtail_demo.mod [Wingery] Reply with quote

I like this module and i've just changed it a bit to:

1) prevent a possible 'bug' in the OnUse script of the pillars that cause the player appearance to be stuck as will'o'wisp in case of lag/double click.

2) add persistence for the wings/tail.

Here, the changes i've made:
script: pillar_onuse
Code:

#include "aps_include"
#include "bodypart_inc"

void main()
{
object oPC = GetLastUsedBy();
   //this is to prevent the player from stuck as will_o_wisp if he double click on the pillar and/or due to lag
   if (GetLocalInt(oPC, "InUse") == 1)   return;
   
   SetLocalInt(oPC,"InUse",1);

   

    int nModP = GetLocalInt(OBJECT_SELF,"MODPART");
    int nPart = nModP?NWNX_BODYPART_WING:NWNX_BODYPART_TAIL;
    int nType = GetLocalInt(OBJECT_SELF,"MODTYPE");

    SetBodyPart(oPC,nPart,nType);

    FloatingTextStringOnCreature(
        "Setting "+IntToString(nPart)+" to "+IntToString(nType),
        oPC);

    // Add Persistent wings//
    if (nPart == 29)SetPersistentInt(oPC,"WingsModel",nType);
    if (nPart == 28)SetPersistentInt(oPC,"TailModel",nType,);

    // Need to sync the engine to the client otherwise effects
    // stack.  SetCreatureAppearanceType() can do this, but it
    // must be a change and not application of their current type.
    // Therefore we need a pair.  A delay of about 1.0 second seems
    // to be the safe minium between them.

    // Hide SetCreatureAppearanceType() effects with a flashy effect.
    // You can also do this with Cutscene Invisibility applied before
    // the first SCAT();
    int nApp = GetAppearanceType(oPC);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
        EffectVisualEffect(VFX_FNF_STRIKE_HOLY), oPC, 1.5);
    SetCreatureAppearanceType(oPC,APPEARANCE_TYPE_WILL_O_WISP);
    DelayCommand(1.0,SetCreatureAppearanceType(oPC,nApp));

    DelayCommand(2.0,SetLocalInt(oPC,"InUse",0));
}


Then in Module Propriety on your OnClientEnter script add this [or make and call a function to do this]:
Code:

// include this:
// #include "bodypart_inc"

   //Persistant wings//
   int nType = GetPersistentInt(oPC,"WingsModel"); //Check Wings
   if (nType != 0)
      {
      int nPart = 29;
      SetBodyPart(oPC,nPart,nType);
      int nApp = GetAppearanceType(oPC);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
        EffectVisualEffect(VFX_FNF_STRIKE_HOLY), oPC, 1.5);
        SetCreatureAppearanceType(oPC,APPEARANCE_TYPE_WILL_O_WISP);
        DelayCommand(1.0,SetCreatureAppearanceType(oPC,nApp));
      }
   nType = GetPersistentInt(oPC,"TailModel");  //Check Tail
    if (nType != 0)
      {
      int nPart = 28;
      SetBodyPart(oPC,nPart,nType);
      int nApp = GetAppearanceType(oPC);
      ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
      EffectVisualEffect(VFX_FNF_STRIKE_HOLY), oPC, 1.5);
      SetCreatureAppearanceType(oPC,APPEARANCE_TYPE_WILL_O_WISP);
      DelayCommand(1.0,SetCreatureAppearanceType(oPC,nApp));
      }


*edit* i've FIXED: changed the:
Get/SetLocalInt(OBJECT_SELF,"InUse",1);
to:
Get/SetLocalInt(oPC,"InUse",1);
because Razz it happened that one player clicked one pillar and straightway another one, and yep, it was stuck as will'o'wisp Razz eheh, we tried and we were 3 cool will'o'wisp Smile ( a bit of lag is required to reproduce the bug i believe)
_________________
Antiworld Arena


Last edited by Jantima on Sun May 22, 2005 23:15; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
69_Jeremy_69



Joined: 23 Feb 2005
Posts: 4

PostPosted: Wed Feb 23, 2005 1:25    Post subject: Reply with quote

Interesting. But where do you get the include bodypart_inc?
Back to top
View user's profile Send private message
Jantima



Joined: 11 Feb 2005
Posts: 6
Location: Italy

PostPosted: Wed Feb 23, 2005 20:47    Post subject: Reply with quote

Mmm... must be into the wingtail_demo.mod, that must be into the linnwnx2 [linnwnx2-2.5.3-rc1.tar.gz\linnwnx2\nwn\wingtail_demo.mod] - I dunno if or why there is not into the Windows version, but however i can guess it might work on windows too.

I was going to post some pics of it Smile


In The wingery mod there are this pillars, 4 for tails [lizard, bone devil and no-tail] and 7 for the wings [demon, angel, bat, dragon, butterfly, bird, and no-wings] that OnUse have the script to do the effect and apply the wings/tail model. The system won't really modify the .bic file, so that's why i've used the OnClient enter event and the persistant thing to restore the wings/tail.


In the wingtail_demo.mod there is also another area, called : The Lab; with other functions to change Body Parts, like head chest or any other else Smile But i've just tested it one time, and i've not really used so i've no changes or suggestions about it, but for sure just because i've not so much time, because The Lab is for sure as great as the Wingery is Smile
So actually this bodypart_inc script work for every body part, and not only for wings Smile.
_________________
Antiworld Arena
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
69_Jeremy_69



Joined: 23 Feb 2005
Posts: 4

PostPosted: Wed Jun 01, 2005 2:33    Post subject: Reply with quote

Does anyone have a link to the mod. I don't have a linux box.
Back to top
View user's profile Send private message
Jantima



Joined: 11 Feb 2005
Posts: 6
Location: Italy

PostPosted: Sat Jun 11, 2005 12:00    Post subject: Reply with quote

You can download the linnwnx2-2.5.3-rc1.tar.gz
on windows and extract the archive, then look into it, into the nwn folder, there is the wingtail_demo.mod which is indeed compatible with windows too. Wink
_________________
Antiworld Arena
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Vladiat0r



Joined: 17 Jun 2005
Posts: 25

PostPosted: Fri Jun 17, 2005 3:02    Post subject: Reply with quote

Get/SetBodyPart of NWNXFunctions no longer work with 1.66 patch. Apparently they changed the internal data structures somehow... at least on Linux that we are using.
Back to top
View user's profile Send private message
chunkymonky



Joined: 20 Feb 2005
Posts: 31

PostPosted: Sat Jun 18, 2005 1:08    Post subject: Reply with quote

i hear that there are some linux problems in the update.
Back to top
View user's profile Send private message
Vladiat0r



Joined: 17 Jun 2005
Posts: 25

PostPosted: Sat Jun 18, 2005 1:12    Post subject: Reply with quote

chunkymonky wrote:
i hear that there are some linux problems in the update.
I what you are talking about are the compiler issues that were resolved by Bioware. We currently are running 1.66 on linux.
Back to top
View user's profile Send private message
chunkymonky



Joined: 20 Feb 2005
Posts: 31

PostPosted: Sat Jun 18, 2005 16:01    Post subject: Reply with quote

yeah our server had some problems with some scripts immediately following upgrading to 1.66, it was a relatively simple fix, but I imagine there will be more problems discovered since bioware does not seem to admit that Linux people want to host servers too
Back to top
View user's profile Send private message
orth



Joined: 10 Apr 2005
Posts: 12

PostPosted: Tue Jun 21, 2005 20:33    Post subject: Reply with quote

Vladiat0r wrote:
Get/SetBodyPart of NWNXFunctions no longer work with 1.66 patch. Apparently they changed the internal data structures somehow... at least on Linux that we are using.


I'm experiencing the same messed up functionality for get/setbodypart on Windows 1.66. Are these functions working for anyone on 1.66?
Back to top
View user's profile Send private message
Jantima



Joined: 11 Feb 2005
Posts: 6
Location: Italy

PostPosted: Sun Jul 17, 2005 17:12    Post subject: Reply with quote

Dazzle posted a fix.
http://www.nwnx.org/phpBB2/viewtopic.php?t=296

And Antiworld wingery is no more out of service Cool ... Vladiat0r fixed it, incrementing the offset by 12 Rolling Eyes [change a 0 to a C, he said..]
_________________
Antiworld Arena
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
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, 2005 phpBB Group