Jump to content

Quick Question - Quick Answer


Cipscis

Recommended Posts

  • Replies 804
  • Created
  • Last Reply

Top Posters In This Topic

Just the same way as any other quest, the important part being that you tick the box next to "Start Game Enabled". This will ensure that the script will run automatically when the game is loaded, as opposed to only running once StartQuest has been called on it.

 

Cipscis

Link to comment
Share on other sites

yeah I understand that, but sorry what I meant was with the script.

 

I opened a new script from the Quest Data tab and pasted the code:

 

Begin GameMode

player.AddSpell <GlowEffectAbility>
StopQuest <AddAbilityQuest>

End

 

then I tried to save the script, but it won't let me. Also what type is the script going to be? object, effect or quest?

 

umm am I missing something? (i'm a noob when it comes to scripts...)

Link to comment
Share on other sites

You'll want to attach this script to the quest that you just created, so it should be a "Quest" script. "<GlowEffectAbility>" and "<AddAbilityQuest>" are placeholders for the EditorIDs that you've assigned to your ability and quest. I often use this format to denote placeholders in code, but I really should have explained that before - sorry about that.

 

If you want to learn more about scripting, including things like when to use each type of script and the differences between them, have a look at my Scripting for Beginners tutorial.

 

Cipscis

Link to comment
Share on other sites

@ Rafahil & Cipscis

 

I just read over my weekly digest of this thread and wondered if this method would work for you as well. This is a script to apply an Imagespace Modifier to sunglasses:

ScriptName SunglassesScript
short sIsActive

Begin OnEquip player 
ApplyImageSpaceModifier ISMSunglasses
set sIsActive to 1
End

Begin OnUnequip player  
RemoveImageSpaceModifier ISMSunglasses
set sIsActive to 0
End

Begin OnDrop player
if sIsActive
	RemoveImageSpaceModifier ISMSunglasses
	set sIsActive to 0
endif
End

Wouldn't that work if you used "player.pms DLC03GhoulFXShader" and "player.sms DLC03GhoulFXShader" in place of the ISM commands?

Link to comment
Share on other sites

Hi guys, I'm trying to make a script which when I push the 'H' button, my cloaking device activates, but I have no idea how to write this in script.

 

I have tried looking on the forums for similar questions, no luck, but if someone could help, I would really appreciate it!

 

Thanks guys!

Link to comment
Share on other sites

@HugePinball:

Yeah, that should work perfectly well, but I prefer to use effect scripts when dealing with apparel, as this allows it to be equipped and unequippied via script without any issues - OnEquip blocks won't run when the scripted item is equipped via EquipItem.

 

@elegas:

Please don't bump a question so soon. I was asleep when you asked it so couldn't answer quickly, but that doesn't mean your question isn't going to be answered.

 

In order to do this, you'll need to use FOSE's IsKeyPressed. Here is some basic code that I use to check for keypresses, using the N key as an example:

int bIsNPressed

Begin GameMode

if bIsNPressed != IsKeyPressed 49; N
	set bIsNPressed to bIsNPressed == 0
	if bIsNPressed
	; N has been pressed
	else
	; N has been released
	endif
endif

End

Cipscis

Link to comment
Share on other sites

I got it kinda working, it equips when I push Q (changed cos its easier to reach), however, I have to hold the button to keep the cloak equipped.

 

How can I fix it so It toggles and I don't have to hold it?

 

Here's my code:

 

SCN 01CloakX
Begin GameMode
	
If IsKeyPressed 16
	Player.Equipitem CloakDevice
Else
	Player.Unequipitem CloakDevice
	Endif
Endif
Endif
END

 

Thanks, Cipscis; your a lot of help!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...