Jump to content

Script help please.


Recommended Posts

Having issues with this script. Objective is for player to light a fire. Player MUST have 3 firewood and either oil or a rag,

Erros I am a recieving are...

(11,25): required (...)+ loop did not match anything at input 'Auto'
(11,29): mismatched input '\\r\\n' expecting STATE

Thanks for any help.

 

 

MiscObject Property FWood Auto
MiscObject Property Oil Auto
MiscObject Property Rag Auto
Message Property FireLit Auto
Message Property MoreWood Auto
Message Property Ragoil Auto
Message Property NoItem Auto
Message Property Greet Auto
ObjectReference MyMarker Auto

Event OnActivate(ObjectReference akActionRef)
Greet.show()

Int ItemA = Game.GetPlayer().GetItemCount(FWood)
Int ItemB = Game.GetPlayer().GetItemCount(Oil)
Int ItemC = Game.GetPlayer().GetItemCount(Rag)

If ItemA >= 3 && ItemB >= 1
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(ItemA, 3)
Game.GetPlayer().RemoveItem(ItemB, 1)
; Player has 3 firewood 1 oil the fire will light items will be removed

ElseIf ItemA >= 3 && ItemC >= 1
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(ItemA, 3)
Game.GetPlayer().RemoveItem(ItemC, 1)
; Player has 3 firewood 1 rag the fire will light items will be removed

ElseIf ItemA < 3
MoreWood.show()
; Player has insufficient firewood

ElseIf ItemA >= 3 && ItemB < 1 || ItemA >= 3 && ItemC < 1
Ragoil.show()
; Player has enough firewood but does not have any oil or rags

ElseIf ItemA < 1 && ItemB < 1 && ItemC < 1
NoItem.show()
; Player has none of the required items

EndIf

EndEvent

 

Link to comment
Share on other sites

Hawhaw.. I'm making a on/off fireplace too. I decided to do it without using any requirements. But, I'm using DarkFox127's tutorial on youtube. And using his scripts. Of course, his resources are missing the source for that script so i can't copy the source and make a new script like his tut suggests. :( I'm kinda like dead in the water there and totally bummed..

 

Any ideas, on where i can find a similar script? Or, god forbid make my own. I'm not quite that advanced yet...

Link to comment
Share on other sites

Hawhaw.. I'm making a on/off fireplace too. I decided to do it without using any requirements. But, I'm using DarkFox127's tutorial on youtube. And using his scripts. Of course, his resources are missing the source for that script so i can't copy the source and make a new script like his tut suggests. :sad: I'm kinda like dead in the water there and totally bummed..

 

Any ideas, on where i can find a similar script? Or, god forbid make my own. I'm not quite that advanced yet...

No idea if this will help you. I made a resource mod for original Skyrim that demonstrated a campfire going through various stages of burning (Campfire Stages). Someone else created a text tutorial to go along with it. It may be more complicated than what you desire. But it may give you some ideas.

 

That said, you can use Champollion to decompile PEX files into a readable and re-compile-able format (but it does not appear the same as the original PSC file). This may at least get you past the hurdle with DarkFox127's tutorial.

Link to comment
Share on other sites

Yep, forgot that 'property', fixed that now getting errors, relating to removing the items I am sure, like this...

 

(23,17): type mismatch on parameter 1 (did you forget a cast?)
(24,17): type mismatch on parameter 1 (did you forget a cast?)
(29,17): type mismatch on parameter 1 (did you forget a cast?)
(30,17): type mismatch on parameter 1 (did you forget a cast?)

 

 

MiscObject Property FWood Auto
MiscObject Property Oil Auto
MiscObject Property Rag Auto
Message Property FireLit Auto
Message Property MoreWood Auto
Message Property Ragoil Auto
Message Property NoItem Auto
Message Property Greet Auto
ObjectReference Property MyMarker Auto

Event OnActivate(ObjectReference akActionRef)
Greet.show()

Int ItemA = Game.GetPlayer().GetItemCount(FWood)
Int ItemB = Game.GetPlayer().GetItemCount(Oil)
Int ItemC = Game.GetPlayer().GetItemCount(Rag)

If ItemA >= 3 && ItemB >= 1
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(ItemA, 3)
Game.GetPlayer().RemoveItem(ItemB, 1)

ElseIf ItemA >= 3 && ItemC >= 1
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(ItemA, 3)
Game.GetPlayer().RemoveItem(ItemC, 1)

ElseIf ItemA < 3
MoreWood.show()

ElseIf ItemA >= 3 && ItemB < 1 || ItemA >= 3 && ItemC < 1
Ragoil.show()

ElseIf ItemA < 1 && ItemB < 1 && ItemC < 1
NoItem.show()

EndIf

EndEvent

 

Link to comment
Share on other sites

Well antsubell, I hope you got the help you needed, and I hope you don't mind me piggybacking off your post to get a little help with my similar problem.

 

Thanks IsharaMeradin. I'm so glad someone with your level of knowledge on this stuff is still hanging around here.

Link to comment
Share on other sites

So, eventually got it right. Script is probably way too convoluted but it works so I thought I would share it. Thanks to all for the help.

 

 

MiscObject Property FWood Auto
MiscObject Property Oil Auto
MiscObject Property Rag Auto
Message Property FireLit Auto
Message Property MoreWood Auto
Message Property Ragoil Auto
Message Property NoItem Auto
Message Property Greet Auto
ObjectReference Property MyMarker Auto

Event OnActivate(ObjectReference akActionRef)
Greet.show()


if (Game.GetPlayer().GetItemCount(FWood) >= 3) && (Game.GetPlayer().GetItemCount(Oil) >= 1)
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(FWood, 3)
Game.GetPlayer().RemoveItem(Oil, 1)

Elseif (Game.GetPlayer().GetItemCount(FWood) >= 3) && (Game.GetPlayer().GetItemCount(Rag) >= 1)
FireLit.show()
MyMarker.Enable()
Game.GetPlayer().RemoveItem(FWood, 3)
Game.GetPlayer().RemoveItem(Rag, 1)

Elseif (Game.GetPlayer().GetItemCount(FWood) < 3)
MoreWood.show()

Elseif (Game.GetPlayer().GetItemCount(FWood) >= 3) && (Game.GetPlayer().GetItemCount(Oil) < 1) || (Game.GetPlayer().GetItemCount(FWood) >= 3) && (Game.GetPlayer().GetItemCount(Rag) < 1)
Ragoil.show()

Elseif (Game.GetPlayer().GetItemCount(FWood) < 1) && (Game.GetPlayer().GetItemCount(Oil) < 1) && (Game.GetPlayer().GetItemCount(Rag) < 1)
NoItem.show()

EndIf

EndEvent

 

Link to comment
Share on other sites

What you have would work, yes. For educational purposes, the same script with a few tweaks including comment marks as to why.

 

 

MiscObject Property FWood Auto
MiscObject Property Oil Auto
MiscObject Property Rag Auto
Message Property FireLit Auto
Message Property MoreWood Auto
Message Property Ragoil Auto
Message Property NoItem Auto
Message Property Greet Auto
ObjectReference Property MyMarker Auto

Event OnActivate(ObjectReference akActionRef)
  If akActionRef == Game.GetPlayer() 
    ; the player activated so do our thing
    ; because the player is the one who activated all future uses of Game.GetPlayer() within this IF block can use akActionRef instead

    Greet.show()

    Int FWoodNum = akActionRef.GetItemCount(FWood)
    Int OilNum = akActionRef.GetItemCount(Oil)
    Int RagNum = akActionRef.GetItemCount(Rag)
    ; because we are needing the count multiple times storing it in a local variable is faster

    if (FWoodNum >= 3) && (OilNum >= 1)
      FireLit.show()
      MyMarker.Enable()
      akActionRef.RemoveItem(FWood, 3)
      akActionRef.RemoveItem(Oil, 1)

    Elseif (FWoodNum >= 3) && (RagNum >= 1)
      FireLit.show()
      MyMarker.Enable()
      akActionRef.RemoveItem(FWood, 3)
      akActionRef.RemoveItem(Rag, 1)

    Elseif (FwoodNum < 3)
      MoreWood.show()

    Elseif (FWoodNum >= 3) && (OilNum < 1) || (FWoodNum >= 3) && (RagNum < 1)
      Ragoil.show()

    Elseif (FWoodNum < 1) && (OilNum < 1) && (RagNum < 1)
      NoItem.show()

    EndIf
  EndIf
EndEvent

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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