Aller au contenu

Photo

Making Duncan walk when player walks


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

#1
Eshme

Eshme
  • Members
  • 756 messages
Hello, im posting this because i cant seem to do it alone.

Im trying to make a change, that will make Duncan follow you walking when the player walks. He walks in all occassions except when he follows you he is running only. This is in the mages tower where i am.
I have been trying to find where Duncans behavior is set, but had no success yet.

Things i discovered so far:

There is functions in the scripts called "Setpartyfollower" and "SetNonpartyfollower".

I have found a script called "party_h" in the Palette Window Area under "Scripts,_Core_Includes" where something is written about Partyfollowers. It sais "WR_SetFollowerState(oFollower, FOLLOWER_STATE_LOCKEDACTIVE)". However i cannot change this script because it is read only. I can change none in fact, i think.

By "Characters" in the Palette Window Area, are only Monsters, but no Duncan.

I tried loading the mage tower map, i think i just accidently found it.  Its Area Layout "lak503d" ,not sure if its the 2nd floor, but im gonna check now.

#2
imgettingpissedoff

imgettingpissedoff
  • Members
  • 9 messages
To edit the resources you get when you install the toolset you need to right click on the file you want to edit and choose the "Check Out" option. Once you're done making your changes, save the file then right click and select the "Check In" option. The database that the developers used was located on the BioWare intranet and was edited in a similar manner to source control systems such as Subversion. You'll need to do the "Check Out/In" process for anything you create on your own as well.

Edit: There was another topic created a while ago about getting party members to walk when your character did as well but, last I checked, there wasn't a way to get it to work.

Modifié par imgettingpissedoff, 14 novembre 2009 - 06:54 .


#3
Eshme

Eshme
  • Members
  • 756 messages
Hm i thought i can load the Map, and thus get to find the NPC, and thus find out what drives it, but the area layout in question is empty of all NPC's.

I tried to place a NPC like Duncan, but i can only do New Resource / Character, and this seems to make a entirely new one. And like i said, the Character Palette only has monsters.



What else can come in question to change NPC behaviour?

I am gona see what i can find out about Triggers, i heard they can make NPC's do something like walking somewhere.

#4
Eshme

Eshme
  • Members
  • 756 messages
Oh cool thanks, i am gona look. Yep i have seen it too, but it seemed nobody tried.

#5
Eshme

Eshme
  • Members
  • 756 messages
It works i can edit the Scripts now. I have found something.

CommandMoveToLocation(lLoc, TRUE); means running
CommandMoveToLocation(lLoc, FALSE); means walking i think
IsStealthy(oMainControlled) means check if the player is on stealth or so? Makes the followers stop
??????(oMainControlled) i dont know how the checks if player is on walk mode

Now if one can check for walking, and add a walk command, would this work?
In this script called "ai_main_h_2" is this:

command _AI_MoveToControlled(int nLastCommandStatus)
{
    command cTacticCommand;
    object oMainControlled = GetMainControlled();
    location lLoc = GetFollowerWouldBeLocation(OBJECT_SELF);
    float fDistance = GetDistanceBetween(OBJECT_SELF, oMainControlled);
    // NOTE: there used to be a distance check but I removed it since it cause followers to linger behind
    // when combat starts
    // yaron nov 28, 2008
    //-----
    // NOTE II: putting the distance check back, now with a very short distance
    // Without a distance check the move commands are eveluated constantly, flooding the AI.
    // This is just to slow it down a bit
    // yaron dec 8, 2008
    if(!IsStealthy(oMainControlled) && nLastCommandStatus == COMMAND_SUCCESSFUL && fDistance > AI_RANGE_SHORT)
    {
        if(AI_BehaviorCheck_AvoidNearbyEnemies())
        {
              // move to player only if no enemies nearby
              object []arEnemies = GetNearestObjectByHostility(oMainControlled, TRUE, OBJECT_TYPE_CREATURE, 1);
            fDistance = GetDistanceBetween(oMainControlled, arEnemies[0]);
            if(fDistance <= AI_RANGE_SHORT)
                cTacticCommand = _AI_DoNothing(-1, nLastCommandStatus, FALSE, TRUE);
            else
                cTacticCommand = CommandMoveToLocation(lLoc, TRUE);
        }
        else
            cTacticCommand = CommandMoveToLocation(lLoc, TRUE);
    }
    else
        cTacticCommand = _AI_DoNothing(-1, nLastCommandStatus, FALSE, TRUE);

    return cTacticCommand;
}

Modifié par Eshme, 14 novembre 2009 - 08:19 .


#6
Eshme

Eshme
  • Members
  • 756 messages
Can someone with programming experience look over this? Does it make sense?
I added a check ,that the Follower Runs at medium Distance, and Walks at close Distance, 2 times for both conditions there.
I dont know what Distance this is, but i didnt find out how to check for walking lol..

command _AI_MoveToControlled(int nLastCommandStatus)
{
    command cTacticCommand;
    object oMainControlled = GetMainControlled();
    location lLoc = GetFollowerWouldBeLocation(OBJECT_SELF);
    float fDistance = GetDistanceBetween(OBJECT_SELF, oMainControlled);
    // NOTE: there used to be a distance check but I removed it since it cause followers to linger behind
    // when combat starts
    // yaron nov 28, 2008
    //-----
    // NOTE II: putting the distance check back, now with a very short distance
    // Without a distance check the move commands are eveluated constantly, flooding the AI.
    // This is just to slow it down a bit
    // yaron dec 8, 2008
    if(!IsStealthy(oMainControlled) && nLastCommandStatus == COMMAND_SUCCESSFUL && fDistance > AI_RANGE_SHORT)
    {
        if(AI_BehaviorCheck_AvoidNearbyEnemies())
        {
            // move to player only if no enemies nearby
            object []arEnemies = GetNearestObjectByHostility(oMainControlled, TRUE, OBJECT_TYPE_CREATURE, 1);
            fDistance = GetDistanceBetween(oMainControlled, arEnemies[0]);
            if(fDistance <= AI_RANGE_SHORT)
                cTacticCommand = _AI_DoNothing(-1, nLastCommandStatus, FALSE, TRUE);
            else                  
                if(fDistance > AI_RANGE_MEDIUM)
                    cTacticCommand = CommandMoveToLocation(lLoc, TRUE);
                else
                    cTacticCommand = CommandMoveToLocation(lLoc, FALSE);
        }
        else
            if(fDistance > AI_RANGE_MEDIUM)
                cTacticCommand = CommandMoveToLocation(lLoc, TRUE);
            else
                cTacticCommand = CommandMoveToLocation(lLoc, FALSE);
    }
    else
        cTacticCommand = _AI_DoNothing(-1, nLastCommandStatus, FALSE, TRUE);

    return cTacticCommand;
}


Modifié par Eshme, 14 novembre 2009 - 09:01 .


#7
Eshme

Eshme
  • Members
  • 756 messages
Regardless, when i save this i get a error that sais:
ai_main_h_2.nss - ai_main_h_2.nss(?): Script must contain either a main or Startingconditional
Compile failed

Is this even a script that is used in the game?

I have found another script called "rules_core" ,which got "follow" actions for allies or so (im not sure) and i changed the TRUE to FALSE at what i believe changes Run to Walk (see above) and saving works there. But oddly i never see a file created in my module folder anywhere, and Duncan still runs.

Am i doing something wrong?

Modifié par Eshme, 14 novembre 2009 - 11:31 .


#8
Guest_KevinBantichai_*

Guest_KevinBantichai_*
  • Guests
To an extent...



What I mean is, I have basically figured out how to make all the characters in your party walk. To the extent that they walk but they don't actaully really follow you, i;m not sure exactly what triggers them to walk, BUT THIS IS THE NEXT STEP IN FIGURING OUT A REAL WALK GROUP TOGGLE!!!!. Okay, what you do is firstly select your party, shale etc etc. Then go into your controls and change the toggle for walk "/" to something easier to reach like "z" unless you have really long fingers. Then select a party member other than your character and navigate that person forward whilst holding down the "z" as this is the new walk toggle. Then your party should be walking with you but its that retarted stop run thing. What you do is, whilst walking with your other party member drag a box around your whole party with the left mouse and than at the same time hold down the right mouse. It takes some time to understand it, trial and error, basically I think when you hold down the right mouse whilst walking with the "z" toggle and selecting your whole group they all walk. Why I said to an extent is, because they don't really follow you while they walk, rather they just walk in a line, now what you do next, is kind of like navigating retarted sheep. To make them walk in another direction make sure you still holding down "z" I think taking it off at this point is okay, but what you do then is drag a box around your whole group again ,basically what this does is it select another party member, and then you direct him onto the path you want to walk to, you have to constantly do this, drop a box around the party to switch to other characters. You can't click on them, you must drag a box, it has something to do with the game thinking you selecting you characters to walk individually or something. But that's the full explanaion as best as I can do it.



I hope some or groups of people, continue to expand upon what I've found, mainly have the characters follow you rather you micromananging thier every movement.



Funnily enough, to an extent, when Bioware said it wasn't included or something like that, it was...?



Kevin Bantichai.