Jump to content

Need another pair of eyes (part 2)


Vagrant0

Recommended Posts

Oddly enough, trying to do the same thing I was last time (a month ago too, imagine that). Trying to make a script to detect if the player has Open Cities active by having a number of checks for when a player enters the world space, or comes within range of some markers. The problem this time is that the damn thing doesn't work. The inits are set, but from what I can tell, the script only runs once, even through it's attached to a quest (as a quest script) and all the actions are within a gamemode block.

 

scn Newscript

short stage
short var1
short var2
short day
short choday3
short skiday3
short anvday3
short ChorrolTest
short ChorrolDeadman
short SkingradTest
short SkingradDeadman
short AnvilTest
short AnvilDeadman

begin gamemode
set stage to getstage VG0OpenCitiesQGlobal
if stage == 0
setstage VG0OpenCitiesQGlobal 1
set day to GameDaysPassed
set ChorrolTest to VGOCChorrol
set skingradtest to VGOCSkingrad
set AnvilTest to VGOCAnvil
set choday3 to 0
set skiday3 to 0
set anvday3 to 0
message "inits set"
endif
if stage == 1

if gamehour <=6 && GameDaysPassed > day
set day to GameDaysPassed
	if chorroldeadman != 1
		set choday3 to choday3+1
	endif
	if skingraddeadman != 1
		set skiday3 to skiday3+1
	endif
	if AnvilDeadman != 1
		set Anvday3 to Anvday3+1
	endif
message "Deadman pass run"
endif

if ChorrolTest != VGOCChorrol
if VGOCChorrol == 0
	message "The gates of Chorrol can be heard closing nearby."
elseif VGOCChorrol == 1
	message "You feel a slight change in the wind."
endif
set ChorrolTest to VGOCChorrol
endif
if SkingradTest != VGOCSkingrad
if VGOCSkingrad == 0
	message "The gates of Skingrad can be heard closing nearby."
elseif VGOCSkingrad == 1
	message "You feel a slight change in the wind."
endif
set skingradTest to VGOCSkingrad
endif 
if AnvilTest != VGOCAnvil
if VGOCAnvil == 0
	message "The gates of Anvil can be heard closing nearby."
elseif VGOCAnvil == 1
	message "You feel a slight change in the wind."
endif
set AnvilTest to VGOCAnvil
endif 
message "running script"
if player.getinworldspace chorrolworld == 1
	set VGOCChorrol to 0
elseif player.getdistance VG0ChorrolTreeresetmarker <= 3500
	set VGOCChorrol to 1
	set chorroldeadman to 1
elseif CastaScriboniaRef.getdistance VG0ChorrolTreeresetmarker <= 3500
	set VGOCChorrol to 1
	set chorroldeadman to 1 
endif

if player.getinworldspace skingradworld == 1
	set VGOCskingrad to 0
elseif player.getdistance VG0OCSkingrad0135000 <= 3500 || player.getdistance VG0OCSkingrad0235000 <= 3500
	set VGOCskingrad to 1
	set skingraddeadman to 1
elseif Dion.getdistance VG0OCSkingrad0135000 <= 3500 || Dion.getdistance VG0OCSkingrad0235000 <= 3500
	set VGOCskingrad to 1
	set skingraddeadman to 1 
endif

if player.getinworldspace Anvilworld == 1
	set VGOCAnvil to 0
elseif player.getdistance VG0OCAnvil011600<= 1600 || player.getdistance VG0OCAnvil021800 <= 1800 || player.getdistance VG0OCAnvil033000 <= 3000
	set VGOCAnvil to 1
	set Anvildeadman to 1
elseif Caenlorn.getdistance VG0OCAnvil011600<= 1600 || Caenlorn.getdistance VG0OCAnvil021800 <= 1800 || Caenlorn.getdistance VG0OCAnvil033000 <= 3000
	set VGOCAnvil to 1
	set Anvildeadman to 1 
endif


if VGOcchorrol == 1
if choday3 >= 3
	if chorroldeadman != 1
		set VGOCChorrol to 0
		set chorroldeadman to 1
		message "Backup triggered."
	endif
endif
endif
if VGOCskingrad == 1
if skiday3 >= 3
	if skingraddeadman != 1
		set VGOCSkingrad to 0
		set skingraddeadman to 1
		message "Backup triggered."
	endif
endif
endif
if VGOCAnvil == 1
if Anvday3 >= 3
	if Anvildeadman != 1
		set VGOCAnvil to 0
		set Anvildeadman to 1
		message "Backup triggered."
	endif
endif
endif
endif
end

 

None of the messages past "inits set" pop up, even after manually changing the global value. I've even compared it with the previous script found in my mod (which does work) below.

 

scn Oldscript

short stage
short var1
short var2
short day
short day3
short ChorrolTest
short ChorrolDeadman

begin gamemode
set stage to getstage VG0RotationTracker
if stage ==0
setstage VG0RotationTracker 1
ChorrolFGPorterREF.setfactionrank VG0DutyGroup 0
SkingradFGPorterREF.setfactionrank VG0DutyGroup 0
set day to GameDaysPassed
set ChorrolTest to VGOCChorrol
set day3 to 0
endif
if gamehour <=6 && GameDaysPassed > day
	ChorrolFGPorterREF.setfactionrank VG0DutyGroup 0
	SkingradFGPorterREF.setfactionrank VG0DutyGroup 0
	VG0SylviaRef.setfactionrank VG0DutyController, 0
	VG0SvenRef.setfactionrank VG0DutyController, 0
	VG0PricaRef.setfactionrank VG0DutyController, 0
	VG0JamalRef.setfactionrank VG0DutyController, 0
	VG0TessaRef.setfactionrank VG0DutyController, 0
set day to GameDaysPassed
if chorroldeadman != 1
set day3 to day3+1
endif
endif
if ChorrolTest != VGOCChorrol
if VGOCChorrol == 0
;message "The gates of Chorrol can be heard closing nearby."
VG0ChorrolPack01Marker.positionworld -66166, 97586, 14482, 0, ChorrolWorld
elseif VGOCChorrol == 1
;message "You feel a slight change in the wind."
VG0ChorrolPack01Marker.positionworld -66166, 97586, 14482, 0, Tamriel
endif
set ChorrolTest to VGOCChorrol
endif
if player.getinworldspace chorrolworld == 1
	set VGOCChorrol to 0
elseif player.getdistance VG0ChorrolTreeresetmarker <= 3500
	set VGOCChorrol to 1
	set chorroldeadman to 1
elseif CastaScriboniaRef.getdistance VG0ChorrolTreeresetmarker <= 3500
	set VGOCChorrol to 1
	set chorroldeadman to 1 
endif
if VGOcchorrol == 1
if day3 >= 3
	if chorroldeadman != 1
		set VGOCChorrol to 0
		set chorroldeadman to 1
;message "Backup triggered."
	endif
endif
endif
end

 

So the question is what I'm missing. The new script still compiles, but doesn't want to work in game. Any ideas?

 

*note*

The lines that check for distance are too long to display here, so are moved to the next line down, fairly sure this isn't the problem as it's all one line in the CS.

Link to comment
Share on other sites

It might not like the fact that you check the same variable with two if statements one after the other. Unlikely though. The script might be having problems setting the stage variable. There also might be something wrong with the quest part, and not the script. I ran through it as best I can, and no other possibilities came to mind. It should work, from what I see. Sorry for not being able to help.

 

Omegano

Link to comment
Share on other sites

It might not like the fact that you check the same variable with two if statements one after the other. Unlikely though. The script might be having problems setting the stage variable. There also might be something wrong with the quest part, and not the script. I ran through it as best I can, and no other possibilities came to mind. It should work, from what I see. Sorry for not being able to help.

 

Omegano

 

Which variable? I know it's not the problem with setting the stage because I tried linking a message with "if getstage" and it worked fine. The quest part looks the same as the one in the working mod, so it can't be that. I'm thinking of just seperating it into different quests, one for each town, and trying it that way. Hopefully once I make it an esm it won't slow down anything with 6 quest scripts running constantly (in addition to all the others people have running).

Link to comment
Share on other sites

[

Which variable? I know it's not the problem with setting the stage because I tried linking a message with "if getstage" and it worked fine. The quest part looks the same as the one in the working mod, so it can't be that. I'm thinking of just seperating it into different quests, one for each town, and trying it that way. Hopefully once I make it an esm it won't slow down anything with 6 quest scripts running constantly (in addition to all the others people have running).

The stage variable. And I've thought about it some more. The way you have it checking the stage variable, it will do both if blocks in the same frame. From what I've heard of Oblivion, it doesn't like doing to many actions at once, at least in the same script. Your solution of splitting it into multiple scripts might work, but see if you can't split the script up within itself. I've looked in the Reznod's Mannequins script, and it is made so that it does only a few actions per frame. That gave me the most trouble, but I think it was required to make it work "smoothly". When I look at your script, I see that a lot of actions can be done at once, and you'll probably going to be adding more. You need to split it up, one way or another.

 

At least, that's what I think.

 

Omegano

Link to comment
Share on other sites

Is there perhaps a command along the lines of WaitOneFrame?

 

Nope. Although I was kinda thinking that, too many if statments being checked constantly within the same script. Unfortunately, there isn't way to seperate the script into different parts since everything needs to run within the gamemode block. I might eb able to seperate some of the stuff with an incremental variable so that each group runs once, then that variable gets adjusted to make the next group run.

Link to comment
Share on other sites

Hmm, not much to add here, I am a skilled modder, but not with scripting, unfortuantly. My grandfather gace me some material on learning how to use the scripting program "python" I want to get into it.

Python is a language, not a program...

Maybe you refer to a compiler? Python is a really nice language, but I use VBScript. It ships with Windows (W2K and up), and is very easy to use.

 

"OblivionScript" (in lack of a better word) is much easier, when you know a "real" scripting language first.

But it's not the same, and you'll have to learn a new language. I started in June, and I've got pretty far, I think :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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