Jump to content

Why is this script not work?


GodofWolves

Recommended Posts

I just realized I typed work, instead of working in the title despite the fact I in my head I though I type the full word. stuff like that happen fairly often for me if I don't proof read what I write or type

 

 

Anyway I am try to make script that makes objects not owned when the an actor dies and so far I have not succeeded.

 

The script self is structurally sound according to geck powerup since it lets me save the script but its is not doing anything in game. It a quest script already attached to a quest that starts whit start game enabled check and script processing delay on default.

 

I happen not have a great understating of the fundamental of programming. until yesterday I had no clue what elseif did. I am probability missing something important I but lack the knowledge to know what I would need to do.

I have tried not using a short and that does not work either. The && is between the variable and getdead since the short to only run once the actor dies seems logical?

I will be trying the out the idea of the short variable and getdead being on separate lines.

scn OwnershipKILLTEST

short JeannieMayWitch

Begin GameMode

if JeannieMayWitch && JeannieMayCrawford.GetDead
	SetCellOwnership NovacJeannieMayHouse
	set JeannieMayWitch to 1
	endif
end

If I could get it working it greatly help my mod

Edited by GodofWolves
Link to comment
Share on other sites

if JeannieMayWitch && JeannieMayCrawford.GetDead

Maybe you mean this?

if (JeannieMayWitch == 0) && JeannieMayCrawford.GetDead

If you don't set that JeannieMayWitch to 1 in some other script, that block will never run

Edited by Fallout2AM
Link to comment
Share on other sites

scn OwnershipKILLTEST

short	JeannieMayWitch 				;variable
						
Begin GameMode

if JeannieMayWitch
elseif JeannieMayCrawford.GetDead
		SetCellOwnership NovacJeannieMayHouse
		set JeannieMayWitch to 1
	endif
end

I tried out my idea of separating it into two lines and it still did not work. Now I am currently out of ideas.

Edited by GodofWolves
Link to comment
Share on other sites

​Hey GodOfWolves,

​If I remember correctly I tried to help you with this recently. I haven't played around with ownership myself but if that script doesn't work you probably need to clear the ownership of all the individual references inside the houses. It would be nice if someone more experienced in using these functions could come and clarify this.

​If my guess is right, you need to call ClearOwnership on the references like this:

scn OwnershipKILLTEST

int	JeannieMayWitch 				;variable
						
Begin GameMode

	if JeannieMayWitch == 0 && JeannieMayCrawford.GetDead
			SetCellOwnership NovacJeannieMayHouse
			Apple1.ClearOwnership
			Beer1.ClearOwnership
			Etc1.ClearOwnership
			Etc2.ClearOwnership
			set JeannieMayWitch to 1
	endif

end

​Probably not an optimal solution, because you have to manually set the ownership of every single reference, which can be a real pain. Besides, mods can add their own references to cells. However, if you wanted something more advanced it would require more advanced scripting and there would be many ways to make this more dynamic (I know some ways myself).

As I said earlier, it would be nice if someone with more experience in using these functions could clarify this. Guessing is not cool.

Link to comment
Share on other sites

that seems pretty time consuming. well I will test out that solution to see if it works.

 

maybe I could use an individual fromlist for each cell? I don't know exactly how advanced that would be; It is just an idea.

Edited by GodofWolves
Link to comment
Share on other sites

that seems pretty time consuming. well I will test out that solution to see if it works.

 

maybe I could use an individual fromlist for each cell? I don't know exactly how advanced that would be; It is just an idea.

 

Yes, certainly. That's one of the many ways to make this more dynamic.

 

Let me know how the testing goes.

Link to comment
Share on other sites

that seems pretty time consuming. well I will test out that solution to see if it works.

 

maybe I could use an individual fromlist for each cell? I don't know exactly how advanced that would be; It is just an idea.

 

Often you can find more than a single approach to solve a problem. You probably could even think to make a single script for all the cells.

However, some basics of scripting would be essential. There's a lot of nice sites around, like this , which are pretty much updated and explain very well.

Link to comment
Share on other sites

according to geck power up

when I put something like sugarbombs1.ClearOwnership, or one for the bed, or a container in the room I get

syntax error (only objects and referenced variables are allowed in this context) and thus it the script can not be saved.

 

I guess I may need to add some more variable things on top of the script. I only understood how to kinda use short just a few days ago. I am at the point where I am a bit confused.

 

well I am going dabble a bit in using form lists and see how that works out and mess around with stuff unless has any better suggestions on how to achieve this

Edited by GodofWolves
Link to comment
Share on other sites

  • Recently Browsing   0 members

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