Scripts and Combat

Chris Parks

Vault Senior Citizen
I need a little bit of help on a script I'm preparing, if indeed it can be done.

Is it possible to prevent combat being entered freely by the player? There's an animation I need to happen and I want the player to still be able to move, but I don't want them to be able to enter combat and simply avoid it each time. This would spoil the fun.

So can it be done? Can the player's ability to enter combat be negated for a short time in some way?

Any help would be appreciated.
 
Well, I really don't know if you can avoid it in full... You can have the script recipient close combat automatically if the animation hasn't been played yet, though. Probably you'll have to reset the animation after that, I.E: animation starts - players enters combat - script ends combat - animation starts again...
I really don't know what's going to happen if the players is quick enough to start combat and hit the critter.
If you need to play that animation more than once I suggest to disable the GUI the first time and leave the player free to act afterwards.
See you.
 
Interesting question... I too don't know if it's possible to avoid it in full (but I doubt it). You can make it so that when the PC initiates combat, it is immediately closed again, before any action can be taken. The "combat animation" thing will still run, but nothing else will happen. This can be achieved by putting any of the below in the script obj_dude:

Code:
procedure combat_p_proc begin
   if(combat_is_initialized) then begin
      terminate_combat;
   end
end

or

Code:
procedure combat_p_proc begin
   if(fixed_param == COMBAT_SUBTYPE_TURN) then begin
      terminate_combat;
   end
end

Timed events won't break if they are interrupted by combat, so no worries there. Any scripted animation will be canceled, though. This can be worked around by setting up the animation that was playing when combat was started - the animation will not play from the beginning as one might expect, but from where it was canceled. This might be difficult to implement though, depending on how many animations you're going to use. I didn't manage to cancel combat without editing the obj_dude script, which means you will have to restart the animation(s) from that script as well. For that to be possible you need to know what animation it was, what critter it was, if it had started, etc, and that could get complex. It is definitely doable though, with some effort.

Note that there could be other solutions to this - I haven't looked into it very much. Hope the above is of some use.
 
Yeah, I'm aware that you can cancel combat once it's started, but that's not quite what I was looking for.

Nevermind, I'll find another way of doing it.
 
You mean you want to do something like when you are told you cannot return to the Vault, and you stuck listening to the Overseer? Is that it?
 
No, I was looking for a way that would disable the player's ability to enter combat but still allow him to move freely about the map. ie, if you clicked on your weapon, you wouldn't start combat.
 
Oh I see. There's this guy that worked on the Fallout editor that might find you someone that can help you, just pm him, don't post in his forum about these things. I Hope he has the time to at least put you on the right track, although It's always difficult to find him these days.
 
I suck at programing but can't you put "combat_is_initialized == null" ?

I mean if the button is pointing to something that's null it won't do anything, or will it?

Or maybe "combat_is_initialized == terminate_combat".
 
Back
Top