Aller au contenu

Photo

Anyone know how to keep Hold Position from breaking my script?


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

#1
Talisander

Talisander
  • Members
  • 173 messages
Hey all,

I've got a trigger set up that keeps the player from moving off the map, while letting enemies move on and off.  It's actually an attempt at a solution for the problem I had here:

http://social.biowar...4/index/3341598

This is the trigger's event script (the important part):


        case EVENT_TYPE_ENTER:
        {
            object oCreature = GetEventCreator(ev);

            if (GetGroupId(oCreature) == GROUP_PC)
            {
               UT_QuickMoveObject(oCreature, "wp_coastexit", TRUE, FALSE, TRUE, TRUE);
            }
        break;
        }


The player moves into the trigger, and immediately they turn around and take one step back.  And a nearby party member says something about why they can't go that way.  It actually works great, both in and out of combat, but I just noticed it doesn't work if the player has selected the "hold position" option for party members.  In that case, the character moving into the trigger just turns around but doesn't move, allowing them to then be moved off the map without triggering the EVENT_TYPE _ENTER on the trigger again.  Sigh.

I've been digging around, and I can't find anything about hold position, or how it overrides movement commands... how hard coded is it?

Can anyone point me in the right direction so I can wreak some vengeance on hold position, or maybe suggest a more peaceful solution?  :P

Any help will be very, very appreciated...  I've been obsessing over this.  Thanks for reading,

Alex

#2
Talisander

Talisander
  • Members
  • 173 messages
Aha, I've just found this page on the wiki:

http://social.biowar...hp/Commands.xls


Now, the question is, do I have to create a new movement command type with RespectHoldPosition set to 0, or can I override the current ones in the 2DA, or can I just change that one variable on the command in scripting?  I'll try seeing if I can change it to false through scripting, first.

Don't mind me.




*edit*  hmmm...  what's the best way to do this?  I'm stumped...

I have no idea if it's possible to edit the boolean values in the commands.gda spreadsheet while the game is running.  Not much of a scripter here.  I'll try to do it through and M2DA override, though that might break the hold position option...

Modifié par Talisander, 16 août 2010 - 08:06 .


#3
FergusM

FergusM
  • Members
  • 460 messages
This might be a bad idea, but you could consider simply overriding one of the move types in commands.xls in a specific way. Creating a new one doesn't seem feasible since the 'constructors' for commands are all specific, you can't just specify a command type, as you've no doubt noticed.

So my thinking is, how about set 'Move to Point' or "Move to Multiple Points' to not Respect Hold Position. Whenever party members move on their own, I think they use move to/away from object (follow PC, attack enemy, run away from enemy). Move to location seems like it would be a player issued command only, so it doesn't need to respect hold position anyway (perhaps?). Then make sure that your script is using CommandMoveToLocation/CommandMoveToMultiLocations (I don't remember what QuickMove uses off the top of my head, but I think it might be CommandMoveToObject).

EDIT: Or pester Craig and David until they tell you how the defence of the Denerim gates works, I certainly can't figure out how they get the darkspawn to run in but prevent the player from leaving.

Modifié par FergusM, 16 août 2010 - 08:59 .


#4
Talisander

Talisander
  • Members
  • 173 messages
Yep, quickmove uses CommandMoveToObject. I've gotten it working with that override, and oddly it doesn't seem to be messing up hold position in combat as far as I can tell... will have to test it more, as I'm sure this solution will come back to haunt me. I guess there's no way of manipulating the RespectHoldPosition part of a command in a script? Darn.

I'll check out the defense of the Denerim gates. I forgot you suggested that in the first thread. I looked at the redcliffe village at night battle, and they actually let you run all around the map in that one. But I do remember Denerim seeming different. I'll check it out.

Thanks Fergus.

Modifié par Talisander, 16 août 2010 - 09:07 .