Jump to content

Is it possible to make a script which runs only if the PC is a specific class?


Recommended Posts

looks like it

 

https://cs.elderscrolls.com/index.php?title=GetIsClass

 

 

lets say a quest is set to run the script "MyScript"

scn MyScript

short CheckClass

begin gamemode

   set CheckClass to GetIsClass Bard  ;just using Bard as an example
   if CheckClass == 0
       Return
   else
      ; Insert the code you want run here
   endif
end


getting a bit rusty

think it should work

would have to test it out and see

Link to comment
Share on other sites

You would have to make that line "player.GetIsClass", unless the script runs on the player, a spell affecting him, etc., as the function needs an actor reference it's called on. Other than that it looks totally fine and should do the job. :thumbsup:

Link to comment
Share on other sites

  • 2 months later...

It depends on what you want to do with the script.

 

A Quest script GameMode block runs constantly every X.Y seconds while not inside a menu. Otherwise the MenuMode block can be used.

 

An Object script runs constantly once every frame, while the object the script runs on is in range or similar. A script on an object at the other end of the world won't always still run under all circumstances.

 

And a Spell script, here it gets a little more complicated. Usually a spell script runs as long as the spell lasts, but the only blocks guaranteed to run are ScriptEffectStart and ScriptEffectFinish, respectively once at the start of the spell's effect and at the end when it runs out. There's also a ScriptEffectUpdate block, but I've had... mixed results with this one, up to it not running even once, like when the spell is an ability or similar. It's pretty much unreliable. Luckily GameMode and MenuMode blocks can also be used inside spell scripts.

 

 

Is your script to affect the player in some way? Their stats or inventory or something?

 

 

Object scripts can run on an actor, but putting these onto the player NPC (Bendu Olo) directly is highly conflict-prone.

Object scripts can also run on a so-called token, an unplayable (=invisible) misc item inside an actor's inventory used to affect/control its "container" (=NPC/player).

 

For actions triggered by some keystroke or similar all 3 types of scripts can be used, when the interaction of choice is checking keypresses and waiting for a specific key to be pressed.

An also very widely used approach is to cast a spell or use a (lesser/greater) power to run the script once or trigger its run.

 

The most prominent advantage of a quest script is its "variables" are globally accessible, as the quest's name is globally useable as well. "<questname>.<variablename>" can be used like everywhere. This is not at all the case for the other script types. There's no way whatsoever to set or read variables from scripts on a token/actor or in spells unless from inside the scripts themselves.

 

 

(See https://cs.elderscrolls.com/index.php?title=Category:Blocktypes)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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