Jump to content

Photo

Script counting kills of people being affected by spell

cs script newbie

  • Please log in to reply
2 replies to this topic

#1
Necrogoroth

Necrogoroth

    Stranger

  • Members
  • Pip
  • 2 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
 

 



#2
kastano

kastano

    Enthusiast

  • Members
  • PipPip
  • 146 posts

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



#3
Necrogoroth

Necrogoroth

    Stranger

  • Members
  • Pip
  • 2 posts

Thanks, got it to run by setting a quest script reference to my spell target if it is a living human, and removing it on spell effect finish.







Also tagged with one or more of these keywords: cs, script, newbie

Page loaded in: 1.034 seconds