Jump to content

Deleted58209541User

Account closed
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Deleted58209541User

  1. I have finished the interior cells for my dungeon mod, and now I'm working on the exterior. I would like to limit the changes my mod makes to a single exterior cell.

     

    However, I have accidentally already created and saved minor changes to several adjacent cells. Is there a way that I can delete all changes to these cells? I am okay with throwing away all my exteriors if that's what it takes.

  2. I'm trying to make several thematic moving objects for a dungeon. Moving platforms, shifting stones, spooky shuddering furniture, etc.

     

    But the Oblivion game engine doesn't like it when you script static objects or activator objects to move. I have made a script which should move an object--visually it DOES move--but the engine keeps the physics of the object at the original location. I have not been able to work around this limitation on my own, even using disable/move/enable tricks.

     

    Rather than keep trying to troubleshoot my script, I would like to examine a successful script of this sort. Would anyone be kind enough to list a mod or two they know of that have moving object scripts?

  3. Thanks QQuix! I think I understand how savegames interact with actors now.

     

    Please correct me if this line of thinking is wrong.

     

    In my use case, PlaceAtMe creates a dynamic(generated at runtime) reference to the ghost. The spawned ghost is non-persistent by default. As a dynamic, non-persistent reference, it will be cleaned from the save file after 72 in-game hours(according to the iHoursToRespawnCell variable). Regardless of the number of ghosts this script spawns, whether the player leaves them dead or alive, they will be deleted from the save file as expected.

     

    Since I can safely use PlaceAtMe, the final script for my trapped door(yet another trapped door, haha!) is:

    ScriptName LohithaHauntedDoorScript
    ;Summons a ghost to the parent ref.
    
    short doOnce
    ref targetMarker
    
    Begin OnReset
    	set doOnce to 0
    End
    
    Begin OnActivate
    	if GetOpenState != 3
    		SetOpenState 0
    		return
    	else
    		if GetLocked == 1
    			 return
    		else
    			SetOpenState 1
    			if doOnce != 0
    				return
    			else
    				set doOnce to 1
    				set targetMarker to GetParentRef
    				targetMarker.PlaceAtMe CreatureGhost
    				PlaySound AMBBreath
    			endif
    		endif
    	endif		
    End
    
  4. Hello again Nexus forums! Today I'm trying to make traps that summon creatures. In Morrowind's daedric shrines there were altar items that summoned daedra when disturbed. I want exactly the same behavior but with ghosts.

     

    I have the following script for when the player disturbs a sacred resting place:

    ScriptName LohithaHauntedDoorScript
    ;Summons a ghost to the parent ref.
    
    short doOnce
    ref targetMarker
    
    Begin OnReset
    	set doOnce to 0
    End
    
    Begin OnActivate
    	if GetOpenState != 3
    		SetOpenState 0
    		return
    	else
    		SetOpenState 1
    		if doOnce != 0
    			return
    		else
    			set doOnce to 1
    			set targetMarker to GetParentRef
    			targetMarker.PlaceAtMe CreatureGhost
    			PlaySound AMBBreath
    		endif
    
    	endif		
    End
    

    The code above performs exactly as I desire. The problem is that, apparently, the PlaceAtMe function causes the player's save file to grow every time it's used. Having suffered massive save files myself, I want to avoid using the PlaceAtMe function.

     

    The construction set wiki recommends to use an existing creature and moving them. I can't seem to get this working. My current attempt uses the following code:

    Begin OnActivate
    	if GetOpenState != 3
    		SetOpenState 0
    		return
    	else
    		SetOpenState 1
    		if doOnce != 0
    			return
    		else
    			set doOnce to 1
    			set targetMarker to GetParentRef
    			PlaySound AMBBreath
    			set summonedGhost to CreatureGhost.CreateFullActorCopy
    			summonedGhost.Disable
    			summonedGhost.MoveToMarker targetMarker
    			summonedGhost.Enable
    		endif
    
    	endif		
    End
    

    Do any of you super knowledgeable folk understand why this wouldn't work? Is it because I'm disabling, moving, and enabling in the same frame? How can I delay these steps to different frames?(if necessary)

  5.  

    Not quite . . . you have to make a loop to check the distance of each and every Actor in the cell

     

    something along the line . . .

    set target to GetFirstRef 69 1
    while target
        if GetDistance(target) < 200  &&  target.GetActorLightAmount() > 30
            ; spooky stuff  to this particular actor which is less than 200 units from the object
        set target to GetNextRef
    loop
    Thank you for the advice! I'm sorry I didn't respond yesterday. I went to a friend's house shortly after posting.
    Your strategy works perfectly, with only one oddity. "GetFirstRef 69 1" and "GetNextRef" do not appear to find the player as an actor. I had to add a player-specific condition.
    For anyone interested, here is the working code for a door that opens and closes based on the proximity of creatures with light sources:
    ScriptName LohithaLightOpenDarkClose
    ;A door opens or closes based on the nearness of a creature with a light.
    
    	float triggerDist
    	float requiredLight
    	ref curActor
    	short shouldOpen
    
    Begin GameMode
    	
    	set curActor to GetFirstRef 69 1
    	set triggerDist to 300
    	set requiredLight to 1
    	set shouldOpen to 0
    
    	if GetDistance PlayerRef < triggerDist && PlayerRef.GetActorLightAmount > requiredLight
    		set shouldOpen to 1
    	endif
    	
    	while (curActor && shouldOpen == 0)
    		if GetDistance curActor < triggerDist && curActor.GetActorLightAmount > requiredLight
    			set shouldOpen to 1
    			break
    		endif
      		set curActor to GetNextRef
    	loop
    
    	if shouldOpen == 1
    		SetOpenState 1
    	else 
    		SetOpenState 0
    	endif
    End
    
  6. Hello everyone. In my Oblivion dungeon I'm trying to make various objects that activate when a creature with a light source comes within a certain distance of them.

     

    I want this effect to happen even when it is a non-player character that approaches the object.

     

    Essentially I want the following code for traps/doors/spooky haunted things:

    begin GameMode
        ref nearestActor = GetNearestActor()
        if GetDistance(nearestActor) && nearestActor.GetActorLightAmount() > 30
            ;Do spooky stuff
        endif
    end
    

    However, I can find no means to get a reference to the nearest actor. GetNearestActor() does not exist.

     

    Does anyone here know of a way to get a reference to the nearest actor? I'm willing to use Oblivion Script Extender functions.

×
×
  • Create New...