Jump to content

Search the Community

Showing results for tags 'onactivate'.

Found 5 results

  1. I have a hard time getting an Activator passed as user activating another Activator. This page suggests that it should be possible: https://cs.elderscrolls.com/index.php?title=Activator Here is a line that I'm trying to use. ECTCompanionNonCombatOrderExecution.Activate ECTCompanionController01 1 - It is being called from ScriptEffectStart block of a self-cast spell. - I am 100% sure that both ECTCompanionNonCombatOrderExecution and ECTCompanionController01 are persistent references. - ECTCompanionController01 in it's OnActivate does nothing else, other than printing a debug console message. - The code line works if I replace ECTCompanionController01 with Player. Is there something I'm missing/misunderstanding about Activators? Here is the complete code that I'm trying to use: scn ECTCompanionCombatOrderMenu01Script ref companionController Begin ScriptEffectStart ;// Works - OnActivate is executed. ECTCompanionNonCombatOrderExecution.Activate Player, 1 ;// Doesnt work - nothing happens. ; set companionController to ECTCompanionController01 ; ECTCompanionNonCombatOrderExecution.Activate companionController, 1 End
  2. I made an NPC with the following script: Begin DisabledNPCScript short done if (done==0) disable set done to 1 endif End DisabledNPCScriptThen I made a door, which, once activated, will enable the NPC. I gave it the following script: Begin EnableDisabledNPC short done if (done==1) return endif if ( OnActivate == 1 ) DisabledNPC->Enable Activate endif End EnableDisabledNPCThe game complains about the "EXPRESSION" and "Right Eval" which means that "OnActivate" is an incorrect expression and that it's also not defined in the script. What am I supposed to define it as? It's neither a short, nor a float. Or is OnActivate simply just broken? Help!
  3. I am trying to script something for an upcoming mod that makes some weapons react like they do in call of duty, but I came into a weird problem. The 12th line and the following should have began as soon as the player gets close enough to the object, in this case an activator, but when i try it out ingame the script works but like if were to begin with onactivate. If I walk up to the activator and click it it runs that script aslong as im close enough to the activator. When I first started making the script it worked out perfectly, but somewhere in the making it for some reason broke. Any help is appreciated, thanks in advance. Scn XXXServiceRiflePrimaryWeaponScript ;Refs ref AmmoGiven ref Activated ref GotAmmo ref HasPrimary ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ;Checks for the gun and gives the player ammo for their current gun begin gamemode set AmmoGiven to 1 + GetRandomPercent * 30 / 100 if getdistance Playerref <= 40 if player.getitemcount WeapNVServiceRifle == 1 if GotAmmo == 0 player.additem Ammo556mm AmmoGiven disable set GotAmmo to 1 endif endif endif end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ;Checks for a primary weapon Begin Gamemode if player.getitemcount WeapNVServiceRifle == 1 set HasPrimary to 1 endif if player.getitemcount Weap10mmSubmachineGun == 1 set HasPrimary to 1 endif end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ;Checks if player has no primary begin gamemode if player.getitemcount WeapNVServiceRifle == 0 if player.getitemcount Weap10mmSubmachineGun == 0 set HasPrimary to 0 endif endif end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ;Removes the players current weapon and gives them the new one, or gives the player the gun when they have none begin onactivate if HasPrimary == 0 player.additem WeapNVServiceRifle 1 player.additem Ammo556mm AmmoGiven disable endif if player.getitemcount Weap10mmSubmachineGun == 1 player.removeitem Weap10mmSubmachineGun 1 XXXGunDropMarkerREF.placeatme Weap10mmSubmachineGun 1 15 0 player.additem WeapNvServiceRifle 1 player.additem Ammo556mm AmmoGiven disable endif end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  4. I can't get the script for my quest to save. It's a simple quest that checks if the player has a key in their inventory. If they don't, it sets the quest to the stage to look for the key. If they do, it sets the stage to the stage after they would've picked up the key. here is my script: the key is created, as is the quest.
  5. Hello, another day, another problem. I have a simple script where I detect what to do for locked objects, depending if they are terminal or door/container. Of course, I found a problem instantly, OnActivate() doesn't fire on locked doors until they are unlocked and actually opened. I fill reference alias with the terminal/door/container and that part works. I fill it when player commands companion to hack/lockpick objects. But then I have script in the alias(that I filled earlier with terminal/door/container) that says: Event OnActivate(ObjectReference akActionRef) Actor myCompanion = CompanionAlias.GetReference() as Actor ObjectReference cTarget = Self.GetReference() as ObjectReference if(akActionRef == myCompanion && cTarget.GetBaseObject() is Terminal) Debug.Notification("We touched terminal") ;this part works for locked terminals elseif(akActionRef == myCompanion && (cTarget.GetBaseObject() is Door || cTarget.GetBaseObject() is Container)) Debug.Notification("We touched door/container") ;this never fires until door is already lockpicked and then opened normally elseif(akActionRef != myCompanion) Debug.Notification("aktionref != companion") ; this works else Debug.Notification("target is not terminal or door") ;this works too endIf CommandTarget.Clear() ; clearing because we never need it again on same object EndEvent What I'm trying to do, is simple, when my companion activates(=starts lockpicking or touches locked door, I do stuff). But I have problems detecting when my companion "activates" locked doors. I could register for distance but I was hoping there is better way. Any ideas? Again, this works fine for locked terminals and non-locked doors. Edit: Yes, my companion has needed keywords and can lockpick doors. It's just I can't seem to detect when it's happening which I need.
×
×
  • Create New...