Author Topic: LETO and 1.69 Horses Help  (Read 417 times)

Legacy_plenzdorf

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
LETO and 1.69 Horses Help
« on: October 28, 2010, 06:02:55 pm »


               My problem sort of hangs in a grey area between scripting and custom content. I've tried the latter and been directed here, so now I'm posting in this section with a request for help. I am asking for a favor, I know, and yes, I could figure this out on my own given sufficient time, but I am hoping a member of our still-awesome-after-all-these-years community might be willing to help me out.

In a nutshell, my problem is that the 1.69 horse scripts (x3_horse_inc, I believe) reverts PCs to their default appearance by racial type to avoid the old "Help, I'm stuck on a horse!" or "Help, I'm a dwarf!" problems.

The problem arises when I try to use LETO (the exe., not LETO script) to change a PCs appearance. For example, when I change a PC's appearance to a Treant and set the PC race to "plant" the race change "sticks" but the appearance reverts to a Myconind. I know others have faced this same problem and I know Axe Murderer (bless him) has a relatively untested workaround for this (a change to the x3_horse_inc) but I am wondering if someone else has found or might suggest a simple and reliable fix for this problem.

I would prefer not to make extensive changes to my OnClientEnter event because it already handles a lot of the module's basic custom functions. Please fine my OnClientEnter even scrip below for reference. If someone can suggest a change to the x3_mod_def_enter or OnClientEnter script I would be willing to experiment with that (with the advice or guidance or someone more learned in scripting than I).

My scripting knowledge is rudimentary at best, and while my summer project will be to learn more scripting I simply do not have the time to learn much at the present. I'd like to get custom appearances working on my server before this summer though, so if anyone would be gracious enough to help me find a solution I would be extremely grateful.

This topic has been discussed a bit in the dead forums, but I can find no definitive answer there.

//::///////////////////////////////////////////////
//:: DMFI - OnClientEnter event handler
//:: dmfi_onclienter
//:://////////////////////////////////////////////
/*
  Event handler for the module-level OnClientEnter event. Initializes DMFI system.
*/
//:://////////////////////////////////////////////
//:: 2008.08.02 tsunami282 - created.

#include "dmfi_init_inc"

////////////////////////////////////////////////////////////////////////
void main()
{
    object oUser = GetEnteringObject();

    // do any other module OnClientEnter work here
    ExecuteScript("x3_mod_def_enter", OBJECT_SELF);

    // initialize DMFI
    dmfiInitialize(oUser);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
And here is my modified x3_mod_def_enter script

//::///////////////////////////////////////////////
//:: Default On Enter for Module
//:: x3_mod_def_enter
//:: Copyright © 2008 Bioware Corp.
//:://////////////////////////////////////////////
/*
     This script adds the horse menus to the PCs.
*/
//:://////////////////////////////////////////////
//:: Created By: Deva B. Winblood
//:: Created On: Dec 30th, 2007
//:: Last Update: April 21th, 2008
//:://////////////////////////////////////////////
#include "_kds1_inc"
#include "se_new_player"
#include "pqj_inc"
#include "x3_inc_horse"

void main()
{
RebuildJournalQuestEntries(GetEnteringObject());
KDS1OnClientEnter();
    object oPC=GetEnteringObject();
    SirElrics_SimplePlayerSetUp(oPC);
    RebuildJournalQuestEntries(GetEnteringObject());
ExecuteScript("x3_mod_pre_enter",OBJECT_SELF); // Override for other skin systems
    if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))
    { // add horse menu
        HorseAddHorseMenu(oPC);
        if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))
        { // restore PC horse status from database
            DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE));
        } // restore PC horse status from database
    } // add horse menu
    if (GetIsPC(oPC))
    { // more details
        // restore appearance in case you export your character in mounted form, etc.
        if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC);
        // pre-cache horse animations for player as attaching a tail to the model
        HorsePreloadAnimations(oPC);
        DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC));
}
}
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #1 on: October 28, 2010, 08:34:18 pm »


               What's the problem with Axe's fix? He's a good coder, so finding a different 'simple and reliable' fix may not be necessary. You might also want to link us to anything you did find.



Funky
               
               

               
            

Legacy_plenzdorf

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #2 on: October 28, 2010, 09:30:42 pm »


               This is the fix, and I don't know how I mixed this up--tsunami282 posted it, and apparently it was

"a suggested change...from ObViews""



The main reason I would call this less than "simple and reliable" is that it's relatively untested (as of the post I found it in) and requires modifying an "inc" script--something that he lexicon warns against doing as a general rule...



One question: does anyone see anything obviously wrong/ potentially buggy about this script? The OP of this "fix" in the dead forums specifically said he could not vouch for its reliability.



[nwscript]

void HorseIfNotDefaultAppearanceChange(object oCreature)

{ // PURPOSE: See if not default appearance

   // Old function, lazy implementation that reverts appearance in inappropriate situations

   //int nRace=GetRacialType(oCreature);

   //int nDefApp=StringToInt(Get2DAString("racialtypes","Appearance",nRace));

   //if (GetAppearanceType(oCreature)!=nDefApp) HorseChangeToDefault(oCreature);

   // Fixed function, inverted the logic to only revert appearance when REALLY needed... DUH!

   int nLooks = GetAppearanceType(oCreature);

   if ((nLooks == HORSE_RACE_MOUNTED_DWARFM) || (nLooks == HORSE_RACE_MOUNTED_DWARFF) || (nLooks == HORSE_RACE_MOUNTED_ELFM)

   || (nLooks == HORSE_RACE_MOUNTED_ELFF) || (nLooks == HORSE_RACE_MOUNTED_GNOMEM) || (nLooks == HORSE_RACE_MOUNTED_GNOMEF)

   || (nLooks == HORSE_RACE_MOUNTED_HALFLINGM) || (nLooks == HORSE_RACE_MOUNTED_HALFLINGF) || (nLooks == HORSE_RACE_MOUNTED_HALFELFM)

   || (nLooks == HORSE_RACE_MOUNTED_HALFELFF) || (nLooks == HORSE_RACE_MOUNTED_HALFORCM) || (nLooks == HORSE_RACE_MOUNTED_HALFORCF)

   || (nLooks == HORSE_RACE_MOUNTED_HUMANM) || (nLooks == HORSE_RACE_MOUNTED_HUMANF))

   {

   HorseChangeToDefault(oCreature);

   }

} // HorseIfNotDefaultAppearanceChange()

[/nwscript]

               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #3 on: October 29, 2010, 10:31:08 am »


               That looks like it's only one function in a function set. We don't use horses on HG - they're polybombs - so I'm not clear on the issues here. I assume there's something preventing you from using GetAppearance and storing the int as a local? In any event, your best bet may well be to simply try the script, and report back any problems you have here. Coming with a particular bug is one thing, but you're going to have to do your own playtest, or post the full include of functions, at a minimum.



Funky
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #4 on: October 29, 2010, 01:32:29 pm »


               I thik that is the  function that BioWare had a bug in out of the X3 horse incluide scripts. .  



Both tsunami28 and Axe know what they are doing. There is no reason to not trust thier  work.  I agree with Funky, Try out tsunami28 solution and post back if you still have trouble with it.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #5 on: October 29, 2010, 08:51:37 pm »


               

plenzdorf wrote...

and requires modifying an "inc" script--something that he lexicon warns against doing as a general rule...


Don't worry too much about this with any of the bioware scripts. When you alter one of it's scripts it basically just copies your version to your script list/resources as an override. If for some reason it gos funky on you(no offense FunkySwerve) you can just delete it from your list and the original one takes over again.

Now for other includes for systems that have nothing to do with bioware's you need to be more careful. If you mess those up and don't know how to fix it, you will most likely need to reinstall the original scripts, which isn't life ending...just more of a pain.



Good luck.
               
               

               
            

Legacy_plenzdorf

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #6 on: October 30, 2010, 12:11:03 am »


               Thanks, everyone. All seems to be in order! LETO racial appearances stick now and none of the modules other systems seem adversely affected in any major way.



One tiny odd thing does happen now though (but I only expect answers to this if someone just happens to know why based on previous experience).



We use the DMFI rest system, but have everywhere set to unlimited rest unless we do a DM event



Unfortunately, now ONE area--our main starting city (which is not the module's start point)--says "this is an unlimited rest area when players press "r," but comes up with the rest menu instead of resting them. So players can only rest in the starting village if they use an alternate rest emote. Again, everywhere else in the module rest just happens when players press "R" with the added cool "fade to black" and animated "Zs" added by the DMFI system.



Funky (and undoubtedly due to some little omission or oversight on my part).



Other than that though, horses work, rest works everywhere else, DMFI DM tools and PC widgets perform perfectly, our teleport systems work, flight systems work, treasure and xp systems work, death system works, and we've tested them all several times over the past few days trying to simulate as many variables and combinations as we can.



I'll post back here if I have more issues *crossed fingers against this* and I' mainly replying now to say "THANKS!" and to share this information with others who might, like me, be picking through forums looking for solutions.



My instinct was to test Tsunami (since I use several things he invented already and they perform without any bugs). Glad to know I was right.
               
               

               
            

Legacy_plenzdorf

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
LETO and 1.69 Horses Help
« Reply #7 on: October 30, 2010, 07:01:41 am »


               Please ignore my above post regarding the "problem" this was something I solved a year ago and has nothing to do with the horse script or leto issue. The problem is also 100% resolved, and I'm proud to say our server, World of Abred, is up and running bug-free. Had a NWC event tonight and we all had a blast!!



Thanks again for the helpful advice, folks!