Jump to content

Wits End!


AmeaAya

Recommended Posts

Oh yeah that's true about the returns. I suppose if you want them to have to offer them in that order it works.

 

Hmm... you might try the parenthesis thing...

 

And what exactly did you change that made it not work?

 

 

Oh and are you loading through OBSE? j/k

 

Well it worked when there was no else at the end, and just a return.

However this had the also serious problem of making the entire script stop working if activated while you don't have the items.

 

Parenthesis did nothing.

Link to comment
Share on other sites

This

 

if player.GetIsSex Female == 1
if player.GetItemCount Apple >= 30

 

Should be

if (player.GetIsSex Female == 1) && (player.GetItemCount Apple >= 30)

 

the "&&" means "and". So if female is true, or 1, and itemcount is atleast 30 then the block will run

 

///

 

 

The first "endif" in the following code needs to be removed. The "endif" closes the "if" statement. So, the "else player.getissex male" line might not run.

 

endif
else player.GetIsSex Male == 1
message "Wrong gender! Blah!"
player.PushActorAway player 50
PlaySound WPNSwishLarge
endif
end

Link to comment
Share on other sites

Well, you are correct ragna, but in this case I'd say the OP did it more correctly. He has several different things to test, but only if the player is a female, so he used nested if's. Which is a lot easier then typing the whole getissex thing 6 times.

 

I thought that at first to so I copied and pasted it into notpad to add normal formatting while I looked it over.

 

And sorr, but at this point I'm out of ideas...

Link to comment
Share on other sites

This

 

if player.GetIsSex Female == 1
if player.GetItemCount Apple >= 30

 

Should be

if (player.GetIsSex Female == 1) && (player.GetItemCount Apple >= 30)

 

the "&&" means "and". So if female is true, or 1, and itemcount is atleast 30 then the block will run

 

///

 

 

The first "endif" in the following code needs to be removed. The "endif" closes the "if" statement. So, the "else player.getissex male" line might not run.

 

endif
else player.GetIsSex Male == 1
message "Wrong gender! Blah!"
player.PushActorAway player 50
PlaySound WPNSwishLarge
endif
end

 

Did both of these, and it does the same.

Nothing.

 

It's an activator made from a copied Shrine of Sheogorath, with a Soul Trap effect shader on it.

The only other code is a OnLoad to play the shader.

 

It won't activate for a female or a male, with or without items.

 

EDIT: I added a "message "activated" right after the OnActivate, and it appears to work the first time but not ever again.

Link to comment
Share on other sites

Can you post the code exactly as you have it right now?

 

BTW this is how i would write the code. Try it and tells us what happens and don't worry about the things i took off. We just wanna test the script.

 

scn DoScurselearn

begin OnActivate

if player.GetIsSex Male == 0
message "Wrong gender! Blah!"
return
endif

if player.GetItemCount Apple >= 30
MessageBox "Blah"
Player.RemoveItem Apple 30
Player.AddSpellNS <spell>
return

elseif player.GetItemCount Carrot >= 50
MessageBox "Blah"
Player.RemoveItem Carrot 50
Player.AddSpellNS <spell>
return

elseif player.GetItemCount WelkyndStone >= 10
MessageBox "Blah"
Player.RemoveItem WelkyndStone 10
Player.AddSpellNS <spell>
return

elseif Player.GetItemCount Ratmeat >= 30
MessageBox "Blah"
Player.RemoveItem Ratmeat 30
Player.AddSpellNS <spell>
return

elseif Player.GetItemCount IronCuirass >= 5
MessageBox "Blah"
Player.RemoveItem IronCuirass 5
Player.AddSpellNS <spell>
return

elseif Player,GetItemCount DaedraSilk >= 5
MessageBox "Blah"
Player.RemoveItem DaedraSilk 5
Player.AddSpellNS <spell>
return

else
MessageBox "You have nothing to offer, Begone!"
return
endif
end

Link to comment
Share on other sites

Okay I moved the check for being male to the top, and that works (over and over) but when a female touches it there's a slightly pause (lag) and then it never works again. Here's the current code:

 

scn DoScurselearn

 

 

begin OnLoad

PlayMagicShaderVisuals effectSoulTrap

end

 

begin OnActivate

if player.GetIsSex Female == 0

message "Wrong gender"

player.PushActorAway player 50

PlaySound WPNSwishLarge

return

elseif player.GetIsSex Female == 1 && player.GetItemCount Apple >= 30

MessageBox "---"

Player.RemoveItem Apple 30

Player.AddSpell ---

return

elseif player.GetIsSex Female == 1 && player.GetItemCount Carrot >= 50

MessageBox "---"

Player.RemoveItem Carrot 50

Player.AddSpell ---

return

elseif player.GetIsSex Female == 1 && player.GetItemCount WelkyndStone >= 10

MessageBox "---"

Player.RemoveItem WelkyndStone 10

Player.AddSpell ---

return

elseif player.GetIsSex Female == 1 && Player.GetItemCount Ratmeat >= 30

MessageBox "---"

Player.RemoveItem Ratmeat 30

Player.AddSpell ---

return

elseif player.GetIsSex Female == 1 && Player.GetItemCount IronCuirass >= 5

MessageBox "---"

Player.RemoveItem IronCuirass 5

Player.AddSpell ---

return

elseif player.GetIsSex Female == 1 && Player,GetItemCount DaedraSilk >= 5

MessageBox "---"

Player.RemoveItem DaedraSilk 5

Player.AddSpell ---

return

else

MessageBox "No items"

player.PushActorAway player 50

PlaySound WPNSwishLarge

return

endif

end

 

Edited out the messages and spell names for no real good reaon. I know those aren't the problem anyways.

Link to comment
Share on other sites

I notice a comma at player,getitemcount daedrasilk

I would assume that the compiler would catch that, but maybe it's the problem?

 

...

...

 

GUH

ACK BLAH UGH....

 

 

SON OF A ...

 

GALHDSAHRJ TJQEHTEQIHT:ODIHG:IB

 

Goddamn.

I'm seriously nearly in tears.

 

It works now. Thanks everyone.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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