Jump to content

[Request] Toggleable campfires


Guest deleted2027229

Recommended Posts

Guest deleted2027229

Scenario: you find a camp, there is a campfire, but it's just wood as the fire is out. Turn the wood into an activator called [campfire] which then becomes a burning fire, but you could also douse it again if you wish. Anyone know how I'd do this? I know the basics of making an activator but I wouldn't know how to turn it into a fire.

Edited by WanderRA
Link to comment
Share on other sites

I can't get it to work.

 

So, I'm searching all the static references nearby to find one that is "FireLogPile01". I was able to find one that was placed in a mod. However, I haven't been able to find the static object if it is placed in the base game.

 

As far as I can tell, static objects placed in the base game, so inside the .ESM, do not have any information other than their location, rotation, and formID. None of that information is helpful at all. So, I can't find any way to do this.

Link to comment
Share on other sites

There is a cooking fireplace outside of Dzonot Cave (cell name DzonotCaveExterior in the Tamriel worldspace) which uses a torch as a fire source that comes on from 6pm until 7am (controlled by script ExteriorLightScript). The torch formID is DExteriorTorchFire256wFlame and you will notice that DExteriorCampFire300 uses that same script (and it is used a list of locations around the map).

 

Perhaps you can get a headstart looking at the Bethesda script.

Link to comment
Share on other sites

There is a cooking fireplace outside of Dzonot Cave (cell name DzonotCaveExterior in the Tamriel worldspace) which uses a torch as a fire source that comes on from 6pm until 7am (controlled by script ExteriorLightScript). The torch formID is DExteriorTorchFire256wFlame and you will notice that DExteriorCampFire300 uses that same script (and it is used a list of locations around the map).

 

Perhaps you can get a headstart looking at the Bethesda script.

 

You're talking about hand-placed activators. That's the exact thing that wouldn't work. OP wants any random "FireLogPile01" to be able to "start a fire." Problem is, that's a static object, and it doesn't seem like you can get any useable information from a static object in the base game.

 

I setup a script to search through all the statics in the area and return true if one of them was "GetIsID FireLogPile01". The script can find the object if it is placed by a mod, but it doesn't find any of them that are inside Oblivion.ESM.

Edited by Ortorin
Link to comment
Share on other sites

 

There is a cooking fireplace outside of Dzonot Cave (cell name DzonotCaveExterior in the Tamriel worldspace) which uses a torch as a fire source that comes on from 6pm until 7am (controlled by script ExteriorLightScript). The torch formID is DExteriorTorchFire256wFlame and you will notice that DExteriorCampFire300 uses that same script (and it is used a list of locations around the map).

 

Perhaps you can get a headstart looking at the Bethesda script.

 

You're talking about hand-placed activators. That's the exact thing that wouldn't work. OP wants any random "FireLogPile01" to be able to "start a fire." Problem is, that's a static object, and it doesn't seem like you can get any useable information from a static object in the base game.

 

I setup a script to search through all the statics in the area and return true if one of them was "GetIsID FireLogPile01". The script can find the object if it is placed by a mod, but it doesn't find any of them that are inside Oblivion.ESM.

 

 

Guess it wasn't clear, but all I was pointing out is that the fires are a separate entity, at least in any cases I've ever looked at (both indoors in fireplaces and outdoors in campfires). I was thinking your script could position and then enable one of the campfire light sources.

Link to comment
Share on other sites

Guest deleted2027229

I was thinking make a custom activator with the same mesh as "FireLogPile01", then search+replace all FireLogPile01 statics with my custom activator. But as said I wouldn't know how to make it toggleable. Scripting is not my strong point.

Link to comment
Share on other sites

I was thinking make a custom activator with the same mesh as "FireLogPile01", then search+replace all FireLogPile01 statics with my custom activator. But as said I wouldn't know how to make it toggleable. Scripting is not my strong point.

 

That's exactly what I made. It actually mostly works. The problem, like I said, is that there is no useable information in the static objects. You can find "FireLogPile01" just fine if it was placed down in a mod. Any of the statics that are placed in the base game are not searchable the same way.

 

I tried every single way of getting information out of the statics that I could find, but nothing worked.

Link to comment
Share on other sites

This works for me:

 

I added it to an existing script I use for my own hotkeys. In this case you would put your crosshairs on a logpile and hit LCtrl-F. It will place a specific LIGHT object that is also a fire (FireOpenSmall256), and use the FireLog to positions itself in the game world.

 

QuestScript:

 

 

scn GRCampFireKeyQuestScript
float fQuestDelayTime
long iKeyPressed
long iHotKeyCampFire
long iHotKeyCampFireAlt
ref rItem
ref rItemBase
ref rCampFireLightRef
int bCampFireEnable
float fTemp
ref rCrossHairRef
long iLastKeyPressed
int bCampFireKey
long iKey1
long iKey2
Begin GameMode

if GetGameLoaded
  set fQuestDelayTime to 0.05
  set iHotKeyCampFire to 33    ; F
  set iHotKeyCampFireAlt to 29   ; Left-Ctrl key
  set iLastKeyPressed to 0
endif
if bCampFireEnable
  set bCampFireEnable to 0
  rCampFireLightRef.Enable
  return
endif
;=========================================================================================================
; Process key presses
; ========================================================================================================
set iKey1 to GetKeyPress 0
set iKey2 to GetKeyPress 1
if iKey1 <= 0 || iKey1 > 265
  set iLastKeyPressed to 0
  return
endif
set bCampFireKey to 0
if iKey1 == iHotKeyCampFireAlt && iKey2 == iHotKeyCampFire
  set bCampFireKey to 1
else
  set iLastKeyPressed to 0
  return
endif
if bCampFireKey
  if iLastKeyPressed == iHotKeyCampFire
   return
  else
   set iLastKeyPressed to iHotKeyCampFire
  endif
else
  set iLastKeyPressed to 0
  return
endif
if bCampFireKey
  set rItem to GetCrosshairRef
  if rItem
   set rItemBase to rItem.GetBaseObject
   if rItemBase == FireLogPile01
    set rCampFireLightRef to player.PlaceAtMe FireOpenSmall256 1, 0, 0
    rCampFireLightRef.disable
    set bCampFireEnable to 1
    rCampFireLightRef.setangle x -90.0
    set fTemp to rItem.GetPos x
    set fTemp to fTemp - 2.03   
    rCampFireLightRef.setPos x fTemp
    set fTemp to rItem.GetPos y
    set fTemp to fTemp - 10.755   
    rCampFireLightRef.setPos y fTemp
    set fTemp to rItem.GetPos z
    set fTemp to fTemp + 0.719   
    rCampFireLightRef.setPos z fTemp
    return
   endif
  endif
endif
end

 

 

Edited by GamerRick
Link to comment
Share on other sites

This works for me:

 

I added it to an existing script I use for my own hotkeys. In this case you would put your crosshairs on a logpile and hit LCtrl-F. It will place a specific LIGHT object that is also a fire (FireOpenSmall256), and use the FireLog to positions itself in the game world.

 

QuestScript:

 

 

scn GRCampFireKeyQuestScript
float fQuestDelayTime
long iKeyPressed
long iHotKeyCampFire
long iHotKeyCampFireAlt
ref rItem
ref rItemBase
ref rCampFireLightRef
int bCampFireEnable
float fTemp
ref rCrossHairRef
long iLastKeyPressed
int bCampFireKey
long iKey1
long iKey2
Begin GameMode

if GetGameLoaded
  set fQuestDelayTime to 0.05
  set iHotKeyCampFire to 33    ; F
  set iHotKeyCampFireAlt to 29   ; Left-Ctrl key
  set iLastKeyPressed to 0
endif
if bCampFireEnable
  set bCampFireEnable to 0
  rCampFireLightRef.Enable
  return
endif
;=========================================================================================================
; Process key presses
; ========================================================================================================
set iKey1 to GetKeyPress 0
set iKey2 to GetKeyPress 1
if iKey1 <= 0 || iKey1 > 265
  set iLastKeyPressed to 0
  return
endif
set bCampFireKey to 0
if iKey1 == iHotKeyCampFireAlt && iKey2 == iHotKeyCampFire
  set bCampFireKey to 1
else
  set iLastKeyPressed to 0
  return
endif
if bCampFireKey
  if iLastKeyPressed == iHotKeyCampFire
   return
  else
   set iLastKeyPressed to iHotKeyCampFire
  endif
else
  set iLastKeyPressed to 0
  return
endif
if bCampFireKey
  set rItem to GetCrosshairRef
  if rItem
   set rItemBase to rItem.GetBaseObject
   if rItemBase == FireLogPile01
    set rCampFireLightRef to player.PlaceAtMe FireOpenSmall256 1, 0, 0
    rCampFireLightRef.disable
    set bCampFireEnable to 1
    rCampFireLightRef.setangle x -90.0
    set fTemp to rItem.GetPos x
    set fTemp to fTemp - 2.03   
    rCampFireLightRef.setPos x fTemp
    set fTemp to rItem.GetPos y
    set fTemp to fTemp - 10.755   
    rCampFireLightRef.setPos y fTemp
    set fTemp to rItem.GetPos z
    set fTemp to fTemp + 0.719   
    rCampFireLightRef.setPos z fTemp
    return
   endif
  endif
endif
end

 

 

 

I see what I did wrong. And this was a better way of approaching things. Good job!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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