Author Topic: Horses cep2.3  (Read 757 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« on: August 27, 2012, 08:09:00 pm »


               Ok so I have been tinkering with the horse widgets in cep.

With the widget I can spawn mutiple horses with one widget.

Has anyone a fix for this?
               
               

               


                     Modifié par Knight_Shield, 27 août 2012 - 07:09 .
                     
                  


            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Horses cep2.3
« Reply #1 on: August 29, 2012, 08:04:35 pm »


               I don't use the widgets, as I use another system, ffbj's horse call method

Are you saying that with the widget, multiple uses of the widget causes multiple horses to spawn without destroying the previously-spawned horse

or,

use of the widget enables you to have a choice of different horses that you can spawn

or,

something else?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« Reply #2 on: September 07, 2012, 02:22:53 am »


               If you spawn a horse with your widget ,you can spawn the exact horse over and over while the others are spawned.
               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Horses cep2.3
« Reply #3 on: September 13, 2012, 02:33:57 am »


               You would need to add a check in the calling script to check for an owned horse or to see if the player is mounted. If the player is already mounted or if there is an owned horse, then return the script. Otherwise, allow it to spawn the horse.

You should check out ffbj's package, if only to take a look at how the scripts are set up.

#include "x3_inc_horse"

object oPC = GetItemActivator();

if (HorseGetIsMounted(oPC) || HorseGetHasAHorse(oPC))
{
return;
}
else
{
spawn the horse
}

The one scenario this leaves out is if a PC dismisses an owned horse from the party, but it is still "alive" - a henchman without a master. To look for that, you'd need to loop through creatures in the area/module and see if the name of the creature matches the name of the PC + "'s Horse". If there's a match, end the script. Otherwise continue.

Personally, I destroy dismissed/dismounted horses, but you may have different needs.
               
               

               


                     Modifié par BelowTheBelt, 13 septembre 2012 - 01:35 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« Reply #4 on: September 19, 2012, 01:10:21 pm »


               Thanks BelowTheBelt.

The link is not downloading for meHorse_Call_Method_demo.mod
               
               

               


                     Modifié par Knight_Shield, 19 septembre 2012 - 12:11 .
                     
                  


            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Horses cep2.3
« Reply #5 on: September 19, 2012, 09:06:32 pm »


               Oh?  I just tried it and it DL'd just fine.  Try again and see if it works.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Horses cep2.3
« Reply #6 on: September 19, 2012, 11:06:53 pm »


               Once you dismount if you dismiss the horse it will go away, that is by using the pipes to dismiss the horse.  Now if you are talking about a person dismounting and then logging, well that would probably be the only case where this would occur.

The video:
http://nwvault.ign.c...s.Detail&id=602

Below the Belt:  I think I get what you are referring too. This would be the case where a PC dismounts his horse, leaves it to enter a cave or some such place, and then comes out elsewhere, though you did say dismiss, in which case the horse simply runs off and fades away as in the video. In the former case where the horse is left alive you would have to return to the original location you left the horse in.  So best practice is simply to dismiss the horse with the pipes.  I made a script that goes on inns or wherever you want to give the PC the option to get his horse back in case it died in combat.  If you are using it though you probably know all this. There are a few quirks with the method but overall it works well.
One thing it does allow is constructing horses and call items that can only be used by specific classes, alignments, etc...as with any restrictions on items.  Of course you have to make pipes/scripts for each individual horse.   
               
               

               


                     Modifié par ffbj, 19 septembre 2012 - 10:24 .
                     
                  


            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Horses cep2.3
« Reply #7 on: September 20, 2012, 05:47:08 am »


               I've found that in practice, players will more often use the radial commands to dismount, rather than the pipes.

I do recall instances of where a PC would dismount and dismiss the horse from the party, but rather than running off, it did not run away or destroy itself.  I realized it was an issue when my area cleaner script did not destroy the horse after everyone left the map and it was still there when we returned.

I think this may have been due to PCs dismounting through the radial menu or by using the Party Dismount option in particular.  I remember editing x3_s3_horse to call a new dismount function (which was just a lift from your pipe activate script, I think).  

It's been a while so I'm a little fuzzy on all the details.

As clarification, you do have to make a pipe for each horse, but there's only 1 script to update that will spawn any/all of them, so it's really easy to expand the stable of horses.  

Another thing is that in the OnActivate switch/case that spawns the horses based on the pipe used, it is a good idea to include a case 0 option to spawn a default basic horse.  That way, if there's an issue with the pipe not properly spawning a horse (because there's no local variable or other issue), the PC doesn't get into a situation where the local variable "MountI" is applied (which prevents them from using the pipes again because that variable doesn't get removed until dismounting), but doesn't get a spawned horse with which to mount/dismount.  Having a default backup option ensures that at least some type of horse spawns.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Horses cep2.3
« Reply #8 on: September 21, 2012, 12:10:24 am »


               Yeah, I can tell you have use the system. I specifically instruct people to use the individual mount and dismount, not the party dismount, but you know how that goes. That system was designed to work with individual mount and dismoutn. So good work arounds for instances I envisioned but did not code for. In later updates I put in the onenter for Inns and such that remove the mount I. The pipes themselves only mount auto on the call. Once on the horse if you use the pipes nothing happens, then when you dismount you can dismisss the horse normally. The only real problem I have had with the MountI is if you call a horse while in combat and the horse is killed before you mount it. Then the script assumes you are mounted, but since you never actually mounted the horse there is a disconect between the conditions. I suppose you could do a return if IsInCombat returns True. That's why I added a delete MountI for Inns for that rare though possible condition. The other thing is that when you enter a building without dismount, i.e. using the standard Bioware automatic dismount the local int is not deleted so I added:
void main()
{
object oPC = GetEnteringObject();
 if (!GetIsPC(oPC))
   return;
object oDatabase = GetItemPossessedBy(oPC, "database");
 DeleteLocalInt(oDatabase,"MountI");
}
To the onenter  of buildings. Usually it was not  a big deal as the PC would enter a building buy a few things go back out and re-mount their horse.  I just thought it was best practice to delete the local on the database as it persists over resets, though the onclient enter also deletes MountI.  So say a player exists the game mounted and the server resets they return to game unmounted in their vanilla condition, since they can always call their horse again.  So as we all know horses can be a bit problematic but if you follow the instructions and use the supplied scripts, it should work well. Though, as you point out, there is always room for improvement.
Btw MountI was originally conceived as a fail-safe mechanism to prevent the summoning, spawning, of multiple horses, so by design you must have the database object on the PC, which is where MountI is stored.  If you don't have that item on the PC, which most all pw's will have some sort of database object then you will have a probelm.  As MountI is looked for but never found.
Amazingly or not, I have had virtually no feed-back on this method.  So that either means people are using it and it works, or as in your case, they have adapted it to their own purpose, or no one uses it.  So it is nice to get some feed-back on the specifics of the system though there have been many postive responses.
Love it! Works Great! Is all very nice but careful disection is more useful.
Thanks for the useful comments. 
               
               

               


                     Modifié par ffbj, 20 septembre 2012 - 11:32 .
                     
                  


            

Legacy_Ed Venture

  • Full Member
  • ***
  • Posts: 200
  • Karma: +0/-0
Horses cep2.3
« Reply #9 on: January 01, 2013, 01:58:48 pm »


               Hello. I am a noob. I am in the middle of building my first mod using cep, and other haks. What follows is my hak order...
enigma3 (only way I could get horse menu on PC)
sx_intimate
cep_add_doors/tile/tiles2/pheno5,4,3,2,1/race_a/rules/sb_v1/skies/tiles1
cep_build/core7,6,5,4,3,2,1,0/crp/crp_s/custom/ext_tiles/patch_v22b,v22c/top_v24
I am months into building and was testing with a single Palidan. Everthing was working fine.
I then tried to test with an older Palidan(built to play Gladiatrix) and now have an unusual problem.
When I try to mount a horse, summoned or otherwise, the horse appears over the PC's head.
And this is where everyone moans. I have downloaded and played hundreds of mods. I have never removed anything from my hak or overide files. Yeah I know, I'm an idiot.
Version Diamond,1.69,Cep24
Can anyone help me ?
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Horses cep2.3
« Reply #10 on: January 03, 2013, 01:14:44 am »


               This is due to a problem with characters made prior to certain patches. i.e. 1.69
I fixed the problem in my horse method after I became aware of it, though that does not involve cep.
As I recall it's phenotype fix in the onclient enter, though the summoning of a mount is a special case, so that would have to be addressed to.  It is a known problem though, so someone has probably fixed it.  Anyway on client enter I added:

 HorsePreloadAnimations(oPC);
       if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))
      { // add horse menu
       HorseAddHorseMenu(oPC);
      }
  //this piece for characters prior to 1.69 since they won't have it.
  HorseIfNotDefaultAppearanceChange(oPC);
  if (GetCreatureTailType(oPC) == 0)
   {
   SetCreatureTailType(14, oPC);
   }
   //this is the fail safe for appearance.
Now the paladin is a special case and I have not looked at the specific scripts, but the horse on top of the pc occurs due to an appearance malfunction.  Good Luck.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« Reply #11 on: January 30, 2013, 09:30:06 pm »


               Ok , I'm back to horses again. I would like to use     ffbj's horse call method  


Question ? Will someone help me convert this to widget instead of gloves?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« Reply #12 on: January 30, 2013, 10:05:33 pm »


               Ok I made a widgt that starts conversation.


Here is existing script#include "zep_inc_phenos"

#include "x2_inc_switches"
void main()
{
object oPC;
object oItem;

string oString;
int nMount;
int nEvent = GetUserDefinedItemEventNumber();
if (nEvent == X2_ITEM_EVENT_EQUIP)
{
oPC = GetPCItemLastEquippedBy();
//specify horse below
nMount = nCEP_PH_HORSE_BLACK;
zep_Mount(oPC, OBJECT_INVALID, nMount);
SetLocalInt( oPC, "Mounted", 1);
return;
}

else if (nEvent == X2_ITEM_EVENT_UNEQUIP)
{
oPC = GetPCItemLastUnequippedBy();
zep_Dismount(oPC);
SetLocalInt( oPC, "Mounted", 0);
}
}
               
               

               


                     Modifié par Knight_Shield, 30 janvier 2013 - 10:06 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Horses cep2.3
« Reply #13 on: January 30, 2013, 10:44:36 pm »


               Could do something kinda like so (this method skips the conversation though):


#include "zep_inc_phenos"
#include "x2_inc_switches"
void main()
{
    int nEvent = GetUserDefinedItemEventNumber();
    if (nEvent != X2_ITEM_EVENT_ACTIVATE) return;

    object oPC = GetItemActivator();
    int nMount = nCEP_PH_HORSE_BLACK;
    int iMounted = GetLocalInt(oPC, "Mounted");

    if (iMounted == 0)
    {
        zep_Mount(oPC, OBJECT_INVALID, nMount);
        SetLocalInt(oPC, "Mounted", 1);
    }

    else
    {
        zep_Dismount(oPC);
        SetLocalInt(oPC, "Mounted", 0);
    }
}

Hope that works for ya.

P.S. - Not sure if this is a specific CEP widget that you are using of if you are makine your own but the way I do this is to give all the different colored horse widets the same tag so you only need one script. I just put an int variable on each item that indicated which horse will be summoned/mounted when the item is activated. Same script as above with a little change:

#include "zep_inc_phenos"
#include "x2_inc_switches"
void main()
{
    int nEvent = GetUserDefinedItemEventNumber();
    if (nEvent != X2_ITEM_EVENT_ACTIVATE) return;

    object oPC = GetItemActivator();
    object oItem = GetItemActivated();
    int nMount = GetLocalInt(oItem, "MOUNT_TYPE");
    int iMounted = GetLocalInt(oPC, "Mounted");

    if (iMounted == 0)
    {
        zep_Mount(oPC, OBJECT_INVALID, nMount);
        SetLocalInt(oPC, "Mounted", 1);
    }

    else
    {
        zep_Dismount(oPC);
        SetLocalInt(oPC, "Mounted", 0);
    }
}
               
               

               


                     Modifié par GhostOfGod, 30 janvier 2013 - 11:10 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Horses cep2.3
« Reply #14 on: January 31, 2013, 01:06:43 pm »


                Yes your script worked.'<img'> I will mess with this more this weekend. There are  more scripts in here like area enter that I might need your help tweeking.