Jump to content

Script counting kills of people being affected by spell


Recommended Posts

Hello,

 

After playing Oblivion GOTY for quite a while, i wanted to modify it, so i began studying the concept of TESIV - Scripts and the CS, but being new to the Oblivion CS i ran into a problem and / or a few questions.

 

First, my Questions:

 

- Do scripts have to be attached to some kind of Actor / Object , or is it possible to make a script that runs like all the time, checking for conditions and running through the block if they are met?

 

- Do Variables work globally, i mean, can i use one variable in multiple scriipts or are they local and can only be used in the script in which they are created? And if they work only local, how may i store data worldwide?

 

What i'd like to create:

 

If the player kills another Actor which is affected by a certain spell, it increases a variable by one. Kinda like Soultrap. I've already created a spell with a scripted effect:

 

scn NecSatSpellScript

ref SatTarget

Begin ScriptEffectStart

set SatTarget to GetSelf

if (SatTarget.IsActor != 1) || (SatTarget.GetIscreature == 1)
Message "This Spell works only for Humans!"
SatTarget.dispel NecSatSpell
endif

 

end

 

This should dispel the spell, if the target isn't human, but i have no idea, how to increase the variable which counts the people killed under the spell effect.

 

I'd appreciate it, if someone would be able to help me.

 

With best regards,

 

Necrogoroth

 

Link to comment
Share on other sites

Hallo ,its been a year since i last visited oblivion ,so i ve forget most about modding

first question

there are three kind of scripts

Quest - object - magic

So you propably need a quest script -so make a new quest in the cs and atouch the script

second question

dont mess with global variables .you can do your work with local

they are stored in the savegame.again a quest script is needed

set myquest.varkill to myquest.varkill + 1

varkill is a var declared at myquest quest scrpt

i hope i helped

Link to comment
Share on other sites

  • Recently Browsing   0 members

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