As far as I know, you can already create new global variables in OpenMW-CS. However, is there a way to easily check if a cell has been loaded?
Edit: Damn, MiroslavR ninja'd me!
How do I add an "if" statement to destinations?
Re: How do I add an "if" statement to destinations?
What sjek posted should work. I don't think there is an easier solution than that.Atahualpa wrote:As far as I know, you can already create new global variables in OpenMW-CS. However, is there a way to easily check if a cell has been loaded?
Re: How do I add an "if" statement to destinations?
yep
that's probaply easiest way currently or near it
getting it even simpler would need some way to get visiting in the certain cell, to give the variable naturally to use for travel service. that would need extending fileformat or use set of redefined globals, but naming for every cell in game could be a possible mess and other option is extend the saveformat with script access. bloating values.
other example with those would be some kind of telvanni security camera. camera would be NPC or activator with local script and would pass value, from distance check to global, which would be used to calculate chameleon effect applied to player. interfering with normal npc's in area according to morrowind mechanics.
if there's some way to disable "guards" detecting, then set of specialID npc's could be used to trigger detection by local script values in or to the same global.
the multiple if block structure is hard to pass on this simple. in-build jumptables might still seem similar on the outside if there's not some way to bypass the naming problem. architecture thought. (mark and recall type values..)
if it's needed the startscripts are globals, which are ran on a start of a new game and can be started and shutdown with startscript and stopscript commands xP
if related to mwse getref usage it was about saving the player reference or target or whatnot as "rebaked" global value which could be used with set ref to (playerref) or so making it super fast compared to individual ref calls but not gonna open up wabbajack for that now. fireworks
that's probaply easiest way currently or near it
getting it even simpler would need some way to get visiting in the certain cell, to give the variable naturally to use for travel service. that would need extending fileformat or use set of redefined globals, but naming for every cell in game could be a possible mess and other option is extend the saveformat with script access. bloating values.
other example with those would be some kind of telvanni security camera. camera would be NPC or activator with local script and would pass value, from distance check to global, which would be used to calculate chameleon effect applied to player. interfering with normal npc's in area according to morrowind mechanics.
if there's some way to disable "guards" detecting, then set of specialID npc's could be used to trigger detection by local script values in or to the same global.
the multiple if block structure is hard to pass on this simple. in-build jumptables might still seem similar on the outside if there's not some way to bypass the naming problem. architecture thought. (mark and recall type values..)
if it's needed the startscripts are globals, which are ran on a start of a new game and can be started and shutdown with startscript and stopscript commands xP
if related to mwse getref usage it was about saving the player reference or target or whatnot as "rebaked" global value which could be used with set ref to (playerref) or so making it super fast compared to individual ref calls but not gonna open up wabbajack for that now. fireworks
- silentthief
- Posts: 456
- Joined: 18 Apr 2013, 01:20
- Location: Currently traversing the Ascadian Isles
Re: How do I add an "if" statement to destinations?
Idea similar/kind of like this. Set up global scripts that deny access to the locations, something likesjek wrote:yep
other example with those would be some kind of telvanni security camera. camera would be NPC or activator with local script and would pass value, from distance check to global, which would be used to calculate chameleon effect applied to player. interfering with normal npc's in area according to morrowind mechanics.
if there's some way to disable "guards" detecting, then set of specialID npc's could be used to trigger detection by local script values in or to the same global.
"denyBalmora"
"denyMaarGan"
"DenyVivec"
and these scripts do nothing except run, no data/script entry is needed except perhaps to set to only run every so often (*you don't want to have too many global scripts running as this can deteriorate FPS -- so set up a check to run every so often such as every 5-10 seconds or so). But include the "NPC or activator with local script" --like sjek mentioned, that stops these scripts when you get close enough. Could put an activator that stops these scripts inside the stairs leading to the NPC that gives the siltstrider travel options (for example) -- or perhaps add it as dialog from the silt strider merchant.
What to do then is to check for "scriptrunning" http://www.uesp.net/morrow/editor/mw_cs ... iptrunning
to determine if the deny script is running -- if so, then you set up the denial of service.
Granted -- I do not know if scriptrunning works as dialog filter, so this is untested.
ST the suggestive
PS -- any questions/clarifications, please ask
Re: How do I add an "if" statement to destinations?
there is multiple ways we can do this and the choise is yours ^^
Re: How do I add an "if" statement to destinations?
wow wouldn't it be cool if we had a script builder/editor like that!!!sjek wrote:there is multiple ways we can do this and the choise is yours ^^
Re: How do I add an "if" statement to destinations?
Trust me, the coolness factor drastically decreases after hearing the same line 100 times. -- Which makes me think, why not use Fargoth as a scripting interface?
Re: How do I add an "if" statement to destinations?
I've kinda done it so that each individual place is it's own topic and when you talk to a Silt Strider NPC (in this case Balmora's), a script runs which is just;
Addtopic "Travel to Balmora"
I made all of the Silt Strider NPCs a clone of the Caravan class but called "Silt_Strider". Anyone with that class will get that topic except for any Silt_Strider NPC in (for example) Balmora's Cell/s.
When you click on that topic it runs a script that is similar to the travel to Mournhold script.
I've actually pretty much finished the mod. All I need to do is the boats and some sound effects and stuff. This brings me to another question, how do I add a sound in dialogue?
Addtopic "Travel to Balmora"
I made all of the Silt Strider NPCs a clone of the Caravan class but called "Silt_Strider". Anyone with that class will get that topic except for any Silt_Strider NPC in (for example) Balmora's Cell/s.
When you click on that topic it runs a script that is similar to the travel to Mournhold script.
I've actually pretty much finished the mod. All I need to do is the boats and some sound effects and stuff. This brings me to another question, how do I add a sound in dialogue?
Re: How do I add an "if" statement to destinations?
If playing a sound in dialogue isn't possible then could I loop-
if ( menumode == 0 )
playsound, "LevelUP"
-until the sound is played once?
if ( menumode == 0 )
playsound, "LevelUP"
-until the sound is played once?
Re: How do I add an "if" statement to destinations?
I think I worked it out except now it just plays it on repeat until I pause the game. But once I unpause the game it continues. I even tried StopSound "levelUP"