Aller au contenu

Photo

[Question] Auto-Pause after player party spell cast & ability use via scripting?


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

#1
Torias

Torias
  • Members
  • 873 messages
Ok, first post here, haven't actually downloaded the toolset yet.. just want to see if people think this is at all feasible.

I am a micro-manager in combat, absolutely and completely.

I love the DA combat, but I want it to pause for me automatically more.

So what I want to add:
1) Automatic pause whenever a party member casts a spell or uses a special ability, NOT including each default "auto-attack".
2) Automatic pause whenever a party member casts completes a "move to point" command.
3) Automatic pause whenever a party member's current target dies.
4) Automatic pause whenever a party member's current target moves out of melee range.

So, anyone have any ideas for any or all of them are feasible to accomplish via script changes?

Also, it'd be cool to be able to get the game to select the party member that triggered the pausing and make them active...

And finally, it'd be great to be able to enable or disable this on a party member by party member basis, perhaps with a "sustainable" ability that has 0 upkeep and 0% fatigue....

Barring any definite "no that'll never work", I'll probably start down the path of figuring it out tomorrow night :-)

Modifié par Torias, 23 novembre 2009 - 09:38 .


#2
Qkrch

Qkrch
  • Members
  • 128 messages
Yes, we can!



DA script is event driven and the function ToggleGamePause() will do the trick, the script figured out in my head for points 1) and 3) as minimum.



Good luck, is a good idea.

#3
CID-78

CID-78
  • Members
  • 1 124 messages
well the scripting part should be possible. the issue is that there is no GUI for toggling the diffrent settings. so you wouldn't beable to work with it efficently.

#4
Challseus

Challseus
  • Members
  • 1 032 messages

Torias wrote...

Ok, first post here, haven't actually downloaded the toolset yet.. just want to see if people think this is at all feasible.

I am a micro-manager in combat, absolutely and completely.

I love the DA combat, but I want it to pause for me automatically more.

So what I want to add:
1) Automatic pause whenever a party member casts a spell or uses a special ability, NOT including each default "auto-attack".
2) Automatic pause whenever a party member casts completes a "move to point" command.
3) Automatic pause whenever a party member's current target dies.
4) Automatic pause whenever a party member's current target moves out of melee range.

So, anyone have any ideas for any or all of them are feasible to accomplish via script changes?

Also, it'd be cool to be able to get the game to select the party member that triggered the pausing and make them active...

And finally, it'd be great to be able to enable or disable this on a party member by party member basis, perhaps with a "sustainable" ability that has 0 upkeep and 0% fatigue....

Barring any definite "no that'll never work", I'll probably start down the path of figuring it out tomorrow night :-)


At first, I was thinking, no way in hell this could be done. On further thinking, parts of it may be feasible. More specifically:

1) There is already a function called, ToggleGamePause(int bPause = TRUE) which assumingly will pause the game for you when called. Obviously, that is the most important function for what you want.

2) Whenever someone uses an ability (spell, talent, etc.), it's sent through the script, ability_core.nss. I don't advocate the overriding of any core scripts in any way, shape, or form. However, I was reading one thread, where someone was making a reference about events.xls, which apparently has events contained in it, and a script column that can specify where the event will be processed. So, I have not tried this yet (but will soon), but that may be one way of overriding ability_core.nss.

3) As for determining when someone completes a "move to point" action, I was so sure there was no way, but it turns out, there is a EVENT_TYPE_COMMAND_COMPLETE event, that will contain the command needed (COMMAND_TYPE_MOVE_TO_OBJECT or COMMAND_TYPE_MOVE_TO_LOCATION). So, you would just need to override rules_core.nss for this to work.

4) For dealing with enemy death, I'm pretty sure there is already an EVENT_TYPE_DEATH that can be utililized.

5) As for pausing when a target is out of melee range, I mean, I guess this possible. Do you mean, whenever any target of any party member is out of range? If so, yeah, this is possible.

6) As for selecting party members that caused the pause, there are functions like SetPrimaryControlled(object oFollower) that you may want to check out. Again, I have never used them, but they may be what you're looking for.

7) Finally, yes, I guess you could enable this via a sustained ability. Creating a custom sustained ability is easy enough, as is checking to see if the ability is currently sustained. Something like the following:

effect [] effects = GetEffects(OBJECT_SELF, EFFECT_TYPE_UPKEEP, ABILITY_TALENT_AUTOPAUSE);

Where ABILITY_TALENT_AUTOPAUSE is the constant of the new ability you created.

-----------------------------------------

In conclusion, this is mostly ideas, I don't know how they will pan out, as I haven't tested most of them. But, hopefully, this should get you on the right path.

EDIT: Just snuck a peak at rules_core.nss, in regards to my point, 2). Turns out, when it catches the EVENT_TYPE_COMMAND_PENDING, if the command is an ability, it sends the event to ability_core.nss. So, you may be able to override this particular part of the script, and send things to your own overrided version of ability_core.nss, instead of having to mess with that events 2DA I was talking about. Just another random idea...

Modifié par Challseus, 23 novembre 2009 - 04:12 .


#5
dan_upright

dan_upright
  • Members
  • 39 messages
Would it be possible to add a tactic for "Pause game"? Assuming there isn't one hidden away somewhere already.

#6
Challseus

Challseus
  • Members
  • 1 032 messages

dan_upright wrote...

Would it be possible to add a tactic for "Pause game"? Assuming there isn't one hidden away somewhere already.


Interesting... So, when you create a new ability row in ABI_base.xls, there is a column called showintactics. Setting that to 1 automatically adds it to the list of abilities you can use when setting tactics. Then, the ability itself would just have to be implemented to use ToggleGamePause.

I see what you're getting at though. Instead of scripting all of it, why not let the tactics handle some of it, like pausing when the enemy is out of range?
 
Very interesting indeed...

Modifié par Challseus, 23 novembre 2009 - 04:22 .


#7
Qkrch

Qkrch
  • Members
  • 128 messages
Holy carp Challseus, you almost have written all the code ;)

#8
eiham

eiham
  • Members
  • 38 messages

Challseus wrote...

Interesting... So, when you create a new ability row in ABI_base.xls, there is a column called showintactics. Setting that to 1 automatically adds it to the list of abilities you can use when setting tactics. Then, the ability itself would just have to be implemented to use ToggleGamePause.

I see what you're getting at though. Instead of scripting all of it, why not let the tactics handle some of it, like pausing when the enemy is out of range?
 
Very interesting indeed...


Indeed.  Wouldn't be hard.  If noone has done this by this evening, I plan to put the mod together myself (I've already written a mod that I'm polishing up that adds abilities to the core game).

#9
Mithadris Cousland

Mithadris Cousland
  • Members
  • 6 messages
Has there been any work done in this field since these posts? Highly interested.

#10
anakin5

anakin5
  • Members
  • 258 messages
I am going to add the pause action to tactics system with the next release of my mod (v2.4).