Jump to content

Combat warning mod


silverf51

Recommended Posts

Hello. I'm new to modding, I've messed around with the CS a bit but I have no idea how to do anything like this.

 

What I want is a mod that will give a visual warning whenever the player is targeted by an enemy for combat, like a red box around the edges of the screen or something. I mainly want this because I don't always have sound on and therefore can't hear the combat music, thus if I get targetted from the side or behind I don't know about it until the enemy is attacking me and I havn't even pulled my weapon out.

 

If someone knows how to make this, give me some general tips. I want to get better at modding so I don't want everything done for me, but at the same time I have no idea how to do interface mods nor do I know how to check whether or not the player is in combat.

Link to comment
Share on other sites

I can't be of much help as I'm an absolute newbie at modding but you might find this resource interesting:

http://cs.bethsoft.com/constwiki/index.php...inner%27s_guide

 

I supose what you ask could be done with a loop that constantly checks if the player has been detected using the GetDetected command and outputting some visual if ==1.

 

For the GFX part I really can't help you but with that manual you should be able to make it prompts a message when you're spotted, so you get the alert. Anyway, double-clicking on the sneak button every two seconds or so is kinda having a perfect radar.

 

Good luck with your modding experience!

Link to comment
Share on other sites

I've read the beginner's guide, but it didn't tell me much for something like this.

 

The problem with GetDetected and the sneak eye is that it returns true for any detection, not just hostile ones and I only want this to happen when a hostile target detects me. That and my current character isn't a stealth type anyway (and I like to do some level of roleplaying, hitting sneak every few seconds just wouldn't feel right). Having a message pop up saying I'm detected would work, but not the way I'd like. It would suffice if I can't get a custom effect though.

 

But I do realize that I was rather vague in asking for help so let me elaborate on what specifically I don't know how to do for this.

1. How do I have a script constantly be running (would you use a script for this or is there a better way)?

2. Can I use some kind of trigger event to display something or do I have to have a loop constantly checking if I'm in combat?

3. Just how do I make changes to the interface anyway?

 

That's mainly what I'd like answered for now, if I have more questions (and I'm sure I will) I'll make another post with them, but as far as I can see the three things I asked are nessacary for basic functionality.

Link to comment
Share on other sites

This seems rather easy, isn't there something out for that already?

You could simply add a message (Like a skill-add) that informs you of combat which could do all....

I'll just explain the whole thing, you might not have a clue what you're doing, but you'll learn more of it than when I just hand you over an .esp. Feel free to ask if it isn't working for you though.

 

A questscript could do that for you, but too keep things simple you shouldn't change the interface...but I don't think any F3 things are possible anyway.

A questscript runs every 5 seconds. That should be enough, you could decrease that amount..but that's a matter of testing. You'll need IsInCombat for your thing. That checks if an actor (We'll go for you, the player) is in combat. If so It'll turn to 1. If not, it'll go to 0.

 

A script could be like this:

 

The line behind 'scn' determines what you'll need to look for later. It needs to be one word.

Is just made up the 'incombat'-variable. (short incombat) you may call it 'short chicken', as long if you replace all incombats with chicken. You can change the message by editing the text between the "" 's.

 

scn Combatwarningscript

short incombat

Begin GameMode
if incombat == 0
If Player.IsInCombat == 1
 Message "You're in combat now.", 5
 set incombat to 1
endif
elseif incombat == 1
if Player.IsInCombat == 0
 Message "You're out of combat now.", 5
 set incombat to 0
endif
endif
End

 

''Very interesting.... but how to get that all in''? First place that script, open the script-editor by clicking on the pencil button. Or Gameplay-Edit Scripts. Click script->new to open a fresh window..Paste the thing and be sure it is set to be a Questscript. How? Somewhere at the top, there is a dropdown called 'Script-type' its default is 'Object'. But we're going to attach it to a quest. When that is done press save and close that window.

 

Now we're going to create a 'Quest' (That'll be primarily empty but the script) Click on the Q, or go to Character->Quests.

RightClick on the white left window, with the texts (short names of the quests) and click new.

Give it a nice name, then give it a priority of 60. Be sure that the Start Game Enabled is on (it is by default.)

Then at script it says 'NONE' right now..Look for Combatwarningscript or anything you've placed there.

When you have it, press Ok and save the plugin using the floppy or file-save. Give your plugin a name and be sure to load it in 'data files' when you launch oblivion.

 

Questions? Probably...don't hesitate asking them.

Link to comment
Share on other sites

Kudos given for the detailed explanation! It seemed to me it should be as easy as this, it's just a matter of knowing the wrigt words, wich I do not by now.

 

How do you make a quest script runs every 1 or 2 seconds instead of default 5''? Can this be set for a single script or should you alter the timming for all quest scripts?

Link to comment
Share on other sites

It only alters the questscript you're working on, that being the only one attached to that quest, it doesn't effect the others. There is a special variable called FQuestDelayTime for that. It allows you to increase or decrease the amount of time that a questscript waits to run again..

The normal '5' seconds don't mean you have to wait 5 seconds every time, before it starts. The counter goes every 5 seconds, even if nothing happens. So the moment you're attacked, it could take 2 seconds before you get the message. Your rarely notice it unless you use it to update quests or want to do things at specific moments. Especially in menumode..But you normally should not use quest-scripts for things that are localized. (that happen at a specific place and could be attached to a normal object) Normal objects run their script every frame.

Link to comment
Share on other sites

Okay, now I see. I rewrote the script a bit so that it continually displays "I am in combat!" when in combat instead of just when it begins but it works perfectly. I'm thinking of adding some sort of visual effect on the player when combat begins to make it more noticeable (already looked up a function for that) but now that I have half a clue what I'm doing I think I can figure it out.

 

This seems rather easy...

 

...you might not have a clue what you're doing, but you'll learn more of it than when I just hand you over an .esp.

 

Yes, it was rather easy. What was stopping me from doing this was that I didn't know what I was doing XD. And I did learn some stuff instead of learning nothing having an .esp given to me, that was the reason I asked for help making it instead of that. Very nice reply, there were a few things I didn't get at first but I was able to fill in the gaps in my knowledge with the CS wiki. :thanks:

 

Oh, and to grmblf: you can change how often a quest script runs like this

 

float fQuestDelayTime
set fQuestDelayTime to <something>

Where <something> is how much delay you want between how often the sript runs in seconds. Looked this up because 5 seconds was way too long a delay for me.

Link to comment
Share on other sites

I'm thinking of adding some sort of visual effect on the player when combat begins to make it more noticeable (already looked up a function for that) but now that I have half a clue what I'm doing I think I can figure it out.

 

TriggerHitShader is a nice effect, but you should run it for just a limited time as it will get annoying and it blurs your vision...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...