Aller au contenu

Photo

Horses cep2.3


  • Veuillez vous connecter pour répondre
26 réponses à ce sujet

#1
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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 .


#2
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages
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?

#3
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
If you spawn a horse with your widget ,you can spawn the exact horse over and over while the others are spawned.

#4
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages
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 .


#5
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Thanks BelowTheBelt.

The link is not downloading for meHorse_Call_Method_demo.mod

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


#6
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages
Oh? I just tried it and it DL'd just fine. Try again and see if it works.

#7
ffbj

ffbj
  • Members
  • 593 messages
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 .


#8
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages
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.

#9
ffbj

ffbj
  • Members
  • 593 messages
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 .


#10
Ed Venture

Ed Venture
  • Members
  • 102 messages
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 ?

#11
ffbj

ffbj
  • Members
  • 593 messages
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.

#12
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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?

#13
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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 .


#14
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#15
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
 Yes your script worked.:) I will mess with this more this weekend. There are  more scripts in here like area enter that I might need your help tweeking.

#16
ffbj

ffbj
  • Members
  • 593 messages
The gloves where the first thing I made with Cep in mind since they where the first that came with horses. Later I made the horsecall method for regular Nwn. Just to clarify things. So there are two sperate methods. Mainly all the onenter would do would be to delete the local mount I, so that the PC will have the horse being mounted cleared. Also certain stipulations like a NoMount set to 1 might be in order for areas, like indoors, where horses should not be mounted. I do not know about trying to integrate Cep with the normal horse scripts, which handle this sort of thing. Since they are basically seperate from each other. Probably best to do as you are doing and just going Cep to prevent confusion.

So indoors in the the Cep method I would have the gloves unequipped on enter, rudimetary I know, and that would dismount you.  Then the onequip for the gloves, as I recall, would no allow you to put them on in areas where horses where not allowed. So with an activatable item you want to put in a line if NoMount ==1 return;
for instance. Then all areas with NoMount set to 1 would not allow the item to be used, no horses allowed.
Also in the onenter Bioware has an auto dismount feature which may not work out of the box, though it might dismount you it still would not reset the mount variable.  That was an aside but you want to dismount the player when they try to enter an area that has NoMount set to 1 and adjust there mounted status.  You can simply use the Zep dismount function for this, and run it as an executable on all door that lead from outdoor to internal areas.
Various methods are possible.  For further clarification you could look at the second method separately which uses an activatable item, this is the one I made for Nwn not Cep and look at the onenter for that one.

Modifié par ffbj, 05 février 2013 - 06:06 .


#17
ffbj

ffbj
  • Members
  • 593 messages
So for the Cep gloves which you will not be using I had this onenter or buildings:
//Put this script OnEnter call it nomount
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oItem;
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oPC);

if(GetLocalInt(oPC, "Mounted") != 1)
return;

if (GetIsObjectValid(oItem))
{
AssignCommand(oPC, ActionUnequipItem(oItem));
FadeToBlack(oPC, FADE_SPEED_FASTEST);
DelayCommand(2.8, FadeFromBlack(oPC, FADE_SPEED_FASTEST));
}
}

Then I would just put a line in the on enter of the area which restricts mounts:
ExecuteScript("nomount",GetModule());

Now with the advent of horse support non Cep you have the functions that check for mount restricted areas selected by a variable. Thus:

if (!GetLocalInt(oAreaTarget,"X3_MOUNT_OK_EXCEPTION"))
{ // check for global restrictions
if (GetLocalInt(GetModule(),"X3_MOUNTS_EXTERNAL_ONLY")&&GetIsAreaInterior(oAreaTarget)) bNoMounts=TRUE;
else if (GetLocalInt(GetModule(),"X3_MOUNTS_NO_UNDERGROUND")&&!GetIsAreaAboveGround(oAreaTarget)) bNoMounts=TRUE;
} // check for global restrictions
etc... but since Cep does not use the same method the module does not know you are mounted, so you just have to do it manually. Of course some clever soul could probably just use these functions through Cep by adding a variable like the MountI which was really something internal which I still use. Thus it covers those in my Orilion Nights module that either dismount properly or just click on the door while mounted. That's where those above functions come in the player will they be auto dismounted at that point if they just click on the door.

Modifié par ffbj, 05 février 2013 - 06:48 .


#18
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
 Thanks for your help ffbj.

:wizard:

#19
cmwise

cmwise
  • Members
  • 34 messages
Some really great ideas here and if I was a better scripter I might be able to modify zep_on_activate2 and either destroy the extra horse before the PC could spawn another or check the local area for "his" horse and abort with a text stating "you already have a horse" .  But alas..any change I make to the on activate script just kills the script.

I looked at some of the other horse systems/scripts..like I said great but I am retro fitting the Horsie thing into my mod.
For whatever reason CEP's horses and mounts didn't even load into my palettes so I am making them from scratch. Overall the lack of "real" documentation and support of the CEP horses and mounts is aggravating. Even their starter module doesnt contain all of the horses and mounts.

so the issue is keep it simple and just make it so I dont have each PC running around with a herd of horses!

any ideas about the on activate or is that the wrong approach to cure the multiple spawns of horsies?

#20
ffbj

ffbj
  • Members
  • 593 messages
I beleive arises from the fact that Cep horses came about before horses where officially introduced. This would be the general problem with trying to integrate them into the now horses supported NwN. Anyhow you can still use functions from the new horse scripts within a Cep system. Though I have not tried it. The main thing to determine is how many features you want to include.
To your specific problem. Too many horses. The first thing is that there are functions within the default system to check for this such as:
(HorseGetHasAHorse(oPC) checks to see if PC has a horse.
(HorseGetIsMounted(oPC) checks to see if PC is mounted.
The bioware include: You need to put this script at the top of any script which calls for, i.e. includes the various horse function described therein.
#include "x3_inc_horse"
So either of those should help. I do not know how Cep designates horse ownership so you may not find those functions useful. In other words if Cep does not declare the person as mounted or in ownership of a horse they will have no effect.
In my system I added a Mount variable to indicate being mounted. That should work with any system as long as you have the requisite database object which can have variables written to it.
So I have the line:
if (GetLocalInt(oDatabase, "Mounted") == 1)
return;
So if the above statement is true the PC is mounted and no other mounts can be called.
Therefore if you create the database object and add the above line to your horse mounting script and the PC is mounted the script will return. That is stop at that point.
But, you protest, I don't have a database object.
If you want to create a database item make a single, non-stackable item call it Database and then lower case it database would be the tag and database would be the resref. Then onclient enter you have:
object oDatabase = GetItemPossessedBy(oPC, "database");
if (!GetIsObjectValid(oDatabase))
{
// Now create the database object on the PC
CreateItemOnObject("database", oPC, 1);

}
If they don not have one make them one. Then you can write variables to the object. Very useful for a number of things. Make the item plot not dropable or transferable.
You also need a line in the horse script that checks the PC for the database object:
object oDatabase = GetItemPossessedBy(oPC, "database");
That should give you some help.
I have not looked at the Cep horse scripts in a long time. So it might be a good idea to post your current horse script so the specific problem can be addressed. Btw there can be other problems associated with horese asside from having a string of them. Actually that one is the easiest to solve. Also check custom content or Cep searches related to horeses.

#21
cmwise

cmwise
  • Members
  • 34 messages
Thanks ffbj...I get what you're saying. It just seems confusing that there are so many horse (CEP,CRAP,DLA) scripts all wound around each other. When I look at the include and on activate scripts..there seems like a better(simpler) way to script a horse system. Perhaps that is what your system is? I haven't tried it yet. But honestly didnt want to have to use an item that would have to be equiped. I am not a scripter and totally self taught, which means I have enough info to be detrimental to my module and not enough to fix it! Thanks for the suggestions and help.

CEP owndership seems to be set upon dismount. Once the horse is "dismissed" it seems to be gone, the summon widget simply summons another horse of the same color. Once mounted and dismounted the horse becomes yours for the duration until dismissed either by logging off or using a widget which i cant get to work.  The zep_onactivate2 seems to be the heart for  setting the name and summoning, includes flying too. It appears to assign the variable wyrmling (oWyrmling) to the hourse. I'm not a scripter and have lost patience with this horse thing.

Walking isnt all that bad anyways!:lol:

Modifié par cmwise, 19 février 2013 - 05:51 .


#22
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Ok so I'm having trouble changing the appearrance of the horse .

I want to use the horses with armor.

How do I do that ?

#23
cmwise

cmwise
  • Members
  • 34 messages
I did a download of the CEP horses update. It included the on_zep_activate2 file which contains all the horses that are available to the builder.

For whatever reason none of the horses actually appeared in the palette. So I've gone in and made up mine to match the corresponding horse that is listed in the on_zep_activate2 file, the horse is in the palette they just dont appear under any of the directories.

So each horse, for me anyway,  has become a custom horse. I dont use the armored or barded models at this time, but they were in the palette.

The whole set up for just the CEP and one DLA horse was time consuming and tedious. That is probably why there are other horse systems/scripts offered by some very competent developers.

I finally found the conversation file that goes on each horse so you can have them follow or dismiss the horse. I  use the "hitching_post" so that the horse has a place to "hang" while I have a drink at the local Pub.;)

#24
Knight_Shield

Knight_Shield
  • Members
  • 444 messages

cmwise wrote...



For whatever reason none of the horses actually appeared in the palette. So I've gone in and made up mine to match the corresponding horse that is listed in the on_zep_activate2 file, the horse is in the palette they just dont appear under any of the directories.





I have been there lol.I scratched my head trying to figure out where these horses are.

What I am doing now is testing two ways of having horses.

1) I am using ffbj's system but with a wand .

2) I am using a wand to spawn in the standard 1.69 horses.No converstion for them but they work on the radial             menu and have many settings.And they are on the palette!

     We are testing these both .

     I still cant figure out where to change the appaerance of the horse with ffbj's.Please point me to the armor                horse appearance line.I looked in the zep_phenos and cant find it.  

Modifié par Knight_Shield, 25 février 2013 - 11:57 .


#25
ffbj

ffbj
  • Members
  • 593 messages
I think the horses are all listed like this:
nMount = nCEP_PH_HORSE_BLACK;
So that would be the horse you get. My version of Cep has, in zep_phenos:
switch (nMount)
{
case nCEP_PH_HORSE_AURENTHIL:
case nCEP_PH_HORSE_AURENTHIL_L:
case nCEP_PH_HORSE_BLACK:
case nCEP_PH_HORSE_BLACK_L:
case nCEP_PH_HORSE_BROWN:
case nCEP_PH_HORSE_BROWN_L:
case nCEP_PH_HORSE_NIGHTMARE:
case nCEP_PH_HORSE_NIGHTMARE_L:
case nCEP_PH_HORSE_WHITE:
case nCEP_PH_HORSE_WHITE_L:
case nCEP_PH_PONY_BROWN:
case nCEP_PH_PONY_BROWN_L:
case nCEP_PH_PONY_LTBROWN:
case nCEP_PH_PONY_LTBROWN_L:
case nCEP_PH_PONY_SPOT:
case nCEP_PH_PONY_SPOT_L:
}
Not much help, I suppose.
You may want to pm GoG.

Modifié par ffbj, 27 février 2013 - 02:47 .