Jump to content

trying to add hidden effect without the visual part


neunen

Recommended Posts

i have very little knowledge of scripting :whistling: and was wondering if i could get some help with a few things

ive made a box to hide in (the one from metal gear solid) and i wanted to add an effect similar to a stealth field but without the

visual effect. i took a look at the stealth boy script which calls a function called "scaonactor" but im not able to locate that

actual function in the geck itself to see if i can make the character "hidden" without the see-through look. does anyone if im able to get

at that function within the geck?

 

as it stands now i just have the box add a +30 to stealth when sneaking, but ideally i would like to have the player essentially undetectable if: not already detected+in sneak mode+not moving.

 

oh, another thing i was curious about was if i could make it so that the players weapon unequipped when the box was worn. i tried to have the box take up the weapon slot, but it didnt show up.

 

any help would be greatly appreciated

Link to comment
Share on other sites

The function "scaonactor" is an alias for StopCombatAlarmOnActor, and can be used to remove the player from combat.

 

To forcefully unequip the player's weapon, you could create a "dummy weapon" (or just use an appropriate weapon that already exists within Fallout3.esm) and force it to be equipped then instantly unequipped via EquipItem and UnequipItem.

 

Cipscis

Link to comment
Share on other sites

sweet! thanks Cipscis!

 

so StopCombatAlarmOnActor doesn't actually have anything to do with the visual effect then, correct?

that would be perfect.

 

also for the dummy weapon, im not that familiar with the syntax yet. would it be something along the lines of:

 

start onequip

equipitem xxxxxxx

and vice versa for the unequip?

 

thanks a million

Link to comment
Share on other sites

That's just about right, but there are a couple of things you'll have to do as well. First, you'll have to declare a "ref" variable to store the RefID of the Actor that is equipping/unequipping the dummy weapon, then call EquipItem and UnequipItem on that Actor. You'll also want to set the "HideEquipMessage" flag to 1, like this:

ref rContainer

Begin OnEquip
set rContainer to GetContainer
rContainer.EquipItem DummyWeapon 0 1
rContainer.UnequipItem DummyWeapon 0 1
End

Cipscis

Link to comment
Share on other sites

:D o_O

 

thanks again Cipscis, ill have to pour over your example when im at the geck and can look at some other scripts aswell... im still having a hard time wrapping my head around it.

 

im pretty sure i understand what you are saying though. ill have a dummy weapon, stored in a hidden container, once equipped the script will have to call the reference to that container and equip the weapon from in it while suppressing the equip message. then i can activate the scaonactor under the conditions that the player is not moving and is crouched.

 

i think i might be able to slowly start piecing this together, but ill probably be back with questions if thats ok :happy:

 

thanks again

 

edit: figured out how to place if and endif

Link to comment
Share on other sites

Oops, just realised that I forgot to mention that you'll also have to use AddItem and RemoveItem as well as EquipItem and UnequipItem:

ref rContainer

Begin OnEquip
set rContainer to GetContainer
rContainer.AddItem DummyWeapon 1 1
rContainer.EquipItem DummyWeapon 0 1
rContainer.UnequipItem DummyWeapon 0 1
rContainer.RemoveItem DummyWeapon 1 1
End

Your summary is close to what occurs, but not quite. Instead of having an instance of the dummy weapon present in a remote container, the functions that we use (AddItem, EquipItem etc.) take the FormID of the weapon, meaning that they act independent of any instance of the Form, either a reference in the world or an inventory item in a container.

 

This means that, instead of moving an instance of the weapon back and forth between the player and a remote container, the script will create a new instance (not a reference, as this is an inventory item) with AddItem, cause the player to equip/unequip it with EquipItem/UnequipItem, then destroy the instance with RemoveItem.

 

It looks like you've been confused by the "rContainer" variable, which is set to the return value of GetContainer. This line stores the RefID of the reference which has the scripted item in its inventory in a variable ("rContainer") so that we can later call reference functions (AddItem, EquipItem etc.) on that reference. I hope that explanation made some sense, let me know if it's still unclear.

 

Cipscis

Link to comment
Share on other sites

thanks again, that would make more sense to just create an instance of the weapon, youre right, it was the rContainer that was confusing me.

im still not totally clear on the need to store a reference in script etc. but i think im starting to get it a bit more. heres what ive got so far:

 

ScriptName MGSboxHIDE

ref rContainer

Begin OnEquip
set rContainer to GetContainer
 rContainer.AddItem FakeWeapon 1 1
 rContainer.EquipItem FakeWeapon 1 1
  SetForceSneak 1
if player.IsMoving == 0
 SCAonActor
endif
End

Begin Onunequip
rContainer.UnequipItem FakeWeapon 0 1
rContainer.RemoveItem FakeWeapon 1 1
End

 

will i need to turn off the SCAonActor or will it stop with the end of the script? im also not sure if i should bother detecting if the player is sneaking or just force them to sneak once theyre wearing the box, it does look a little silly if they stand up and run around.

 

thanks again for your help

 

cheers,

neunen

Link to comment
Share on other sites

one other thing i was thinking. i was taking a look at exactly what scaonactor does under the geck wiki, and do you think there is another function that may suit this better? also should i have if conditions for the detection level of just have the player essentially go invisible once the box is on and he/she is still?

 

thanks again

Link to comment
Share on other sites

You'll want to include AddItem, EquipItem, UnequipItem and RemoveItem all in the OnEquip block, instead of splitting them up into a OnEquip block and a OnUnequip block.

 

If you want to prevent the player from equipping weapons while the armour is equipped, then it might be a better idea to do this within a ScriptEffectUpdate/GameMode block instead:

Begin ScriptEffectUpdate
if GetWeaponAnimType
	AddItem DummyWeapon 1 1
	EquipItem DummyWeapon 1 1
endif
End

Then use something like this for the script of the dummy weapon:

Begin GameMode
RemoveMe
End

StopCombatAlarmOnActor won't need to be "switched off", you can call it once to remove an Actor from combat and then they will continue to behave as normal, possibly meaning that they will instantly re-enter combat.

 

If you want to check the player's detection level, you could try using GetDetectionLevel or IsActorDetected.

 

Cipscis

Link to comment
Share on other sites

ok i see what youre saying about the scaonactor, do you know if there is a way to make the player "undetectable"?

would i be able to use SetDetectionLevel or something similar?

 

also the SetForceSneak doesnt seem to be functioning, do i need to set a ref for the player and set it to GetSelf?

 

sorry if these questions are silly and thanks again for your help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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