Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

 

 

Hi Matt, quick question:

 

I have an object I need to hit with a sword, once hit, an explosion occurs, and I get transported to an xmarker heading.

My issue is the "OnHit" set stage alias script on the static object doesn't do anything, of course on hitting it, will set the stage

for an explosion, and transportation.

 

Any pointers?

OnHit doesn't work like it used to. Possibly, you could use extendmagiceffect script. OnEquip addspell/cast spell that has explosion. I use several magic effect scripts to cast additional spells on a hit in this way. In fact there is a vanilla script that has this all written out. Here's the script found in CK:

 

 

scriptName magicCastAnotherSpellScript extends ActiveMagicEffect
{Scripted magic effect for simulating Casting another spell so it can have different casting types.}

import utility
import Debug

;======================================================================================;
;  PROPERTIES  /
;=============/

Spell property CastSpellName auto
{The name of the new Spell we will cast.}

Bool Property AimAtTargets = false auto
{Do you want to aim at targets.}


;======================================================================================;
;  VARIABLES   /
;=============/

Actor CasterRef
Actor TargetRef


;======================================================================================;
;   EVENTS     /
;=============/

Event OnEffectStart(Actor Target, Actor Caster)
	CasterRef = Caster
	TargetRef = Target
	if AimAtTargets == True
; 		Debug.Trace("Other Spell Target is: "+ TargetRef)
; 		Debug.Trace("and the Castor is: "+ CasterRef)
		wait(RandomFloat(0,0.8))
		CastSpellName.cast(Caster,TargetRef)
	else
		CastSpellName.cast(Caster,none)
	endif
EndEvent
 

 

 

 

 

What do you mean "OnHit doesn't work like it used to?"

 

 

Used to (with Oblivion scripting) you could attach OnHit to object script, say a weapon. It would fire as expected, when there was a "hit" with the scripted object. I tried for weeks to add a cast spell to an object using OnHit with nothing to show. The problem arises in working around the target and source. ( http://www.creationkit.com/OnHit_-_ObjectReference )
Using the spoilered script, the OnEffectStart is whatever delivery type you've assigned to the MGEF that the script is attached. Say I have an ENCH with basic shock MGEF and your teleport MGEF using this example script. If you have set the casting type and delivery to Fire and Forget/Contact, and both MGEF are set this way, along with the ENCH being FF/Touch, the result when a hit is made is the target gets shocked and then teleported. And you don't have to set the property for Aimed...only the spell being cast.

 

 

 

Hi Matt, quick question:

 

I have an object I need to hit with a sword, once hit, an explosion occurs, and I get transported to an xmarker heading.

My issue is the "OnHit" set stage alias script on the static object doesn't do anything, of course on hitting it, will set the stage

for an explosion, and transportation.

 

Any pointers?

OnHit doesn't work like it used to. Possibly, you could use extendmagiceffect script. OnEquip addspell/cast spell that has explosion. I use several magic effect scripts to cast additional spells on a hit in this way. In fact there is a vanilla script that has this all written out. Here's the script found in CK:

 

 

scriptName magicCastAnotherSpellScript extends ActiveMagicEffect
{Scripted magic effect for simulating Casting another spell so it can have different casting types.}

import utility
import Debug

;======================================================================================;
;  PROPERTIES  /
;=============/

Spell property CastSpellName auto
{The name of the new Spell we will cast.}

Bool Property AimAtTargets = false auto
{Do you want to aim at targets.}


;======================================================================================;
;  VARIABLES   /
;=============/

Actor CasterRef
Actor TargetRef


;======================================================================================;
;   EVENTS     /
;=============/

Event OnEffectStart(Actor Target, Actor Caster)
	CasterRef = Caster
	TargetRef = Target
	if AimAtTargets == True
; 		Debug.Trace("Other Spell Target is: "+ TargetRef)
; 		Debug.Trace("and the Castor is: "+ CasterRef)
		wait(RandomFloat(0,0.8))
		CastSpellName.cast(Caster,TargetRef)
	else
		CastSpellName.cast(Caster,none)
	endif
EndEvent
 

 

 

 

 

What do you mean "OnHit doesn't work like it used to?"

 

It's always worked for me, at least with spells hitting the thing.

 

Yeah, works for spells with projectile fine...doesn't work at all (at least any method I tried) on contact object like weapons. I could be wrong, Matti probably has a better understanding of scripting. I only suggest a simple script already provided by Bethesda to accomplish that which you desire. :) I used the example and expanded to include four spells, with conditions, to an effect that costs zero "souls" to fire...no enchantment cost. I did this by attaching a script to the weapon (AddPerk simple script, conditioned to OnEquipped), the perk adds a single ability, that ability has the example script attached. This is the only way I could make the weapon's proposed ability to chop heads off and collect souls and not cost anything and still work.

 

That was my Vorpal Blade idea...which I have working in my load order.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

 

 

 

Hi Matt, quick question:

 

I have an object I need to hit with a sword, once hit, an explosion occurs, and I get transported to an xmarker heading.

My issue is the "OnHit" set stage alias script on the static object doesn't do anything, of course on hitting it, will set the stage

for an explosion, and transportation.

 

Any pointers?

OnHit doesn't work like it used to. Possibly, you could use extendmagiceffect script. OnEquip addspell/cast spell that has explosion. I use several magic effect scripts to cast additional spells on a hit in this way. In fact there is a vanilla script that has this all written out. Here's the script found in CK:

 

 

scriptName magicCastAnotherSpellScript extends ActiveMagicEffect
{Scripted magic effect for simulating Casting another spell so it can have different casting types.}

import utility
import Debug

;======================================================================================;
;  PROPERTIES  /
;=============/

Spell property CastSpellName auto
{The name of the new Spell we will cast.}

Bool Property AimAtTargets = false auto
{Do you want to aim at targets.}


;======================================================================================;
;  VARIABLES   /
;=============/

Actor CasterRef
Actor TargetRef


;======================================================================================;
;   EVENTS     /
;=============/

Event OnEffectStart(Actor Target, Actor Caster)
	CasterRef = Caster
	TargetRef = Target
	if AimAtTargets == True
; 		Debug.Trace("Other Spell Target is: "+ TargetRef)
; 		Debug.Trace("and the Castor is: "+ CasterRef)
		wait(RandomFloat(0,0.8))
		CastSpellName.cast(Caster,TargetRef)
	else
		CastSpellName.cast(Caster,none)
	endif
EndEvent
 

 

 

 

 

What do you mean "OnHit doesn't work like it used to?"

 

 

Used to (with Oblivion scripting) you could attach OnHit to object script, say a weapon. It would fire as expected, when there was a "hit" with the scripted object. I tried for weeks to add a cast spell to an object using OnHit with nothing to show. The problem arises in working around the target and source. ( http://www.creationkit.com/OnHit_-_ObjectReference )
Using the spoilered script, the OnEffectStart is whatever delivery type you've assigned to the MGEF that the script is attached. Say I have an ENCH with basic shock MGEF and your teleport MGEF using this example script. If you have set the casting type and delivery to Fire and Forget/Contact, and both MGEF are set this way, along with the ENCH being FF/Touch, the result when a hit is made is the target gets shocked and then teleported. And you don't have to set the property for Aimed...only the spell being cast.

 

 

 

Hi Matt, quick question:

 

I have an object I need to hit with a sword, once hit, an explosion occurs, and I get transported to an xmarker heading.

My issue is the "OnHit" set stage alias script on the static object doesn't do anything, of course on hitting it, will set the stage

for an explosion, and transportation.

 

Any pointers?

OnHit doesn't work like it used to. Possibly, you could use extendmagiceffect script. OnEquip addspell/cast spell that has explosion. I use several magic effect scripts to cast additional spells on a hit in this way. In fact there is a vanilla script that has this all written out. Here's the script found in CK:

 

 

scriptName magicCastAnotherSpellScript extends ActiveMagicEffect
{Scripted magic effect for simulating Casting another spell so it can have different casting types.}

import utility
import Debug

;======================================================================================;
;  PROPERTIES  /
;=============/

Spell property CastSpellName auto
{The name of the new Spell we will cast.}

Bool Property AimAtTargets = false auto
{Do you want to aim at targets.}


;======================================================================================;
;  VARIABLES   /
;=============/

Actor CasterRef
Actor TargetRef


;======================================================================================;
;   EVENTS     /
;=============/

Event OnEffectStart(Actor Target, Actor Caster)
	CasterRef = Caster
	TargetRef = Target
	if AimAtTargets == True
; 		Debug.Trace("Other Spell Target is: "+ TargetRef)
; 		Debug.Trace("and the Castor is: "+ CasterRef)
		wait(RandomFloat(0,0.8))
		CastSpellName.cast(Caster,TargetRef)
	else
		CastSpellName.cast(Caster,none)
	endif
EndEvent
 

 

 

 

 

What do you mean "OnHit doesn't work like it used to?"

 

It's always worked for me, at least with spells hitting the thing.

 

Yeah, works for spells with projectile fine...doesn't work at all (at least any method I tried) on contact object like weapons. I could be wrong, Matti probably has a better understanding of scripting. I only suggest a simple script already provided by Bethesda to accomplish that which you desire. :smile: I used the example and expanded to include four spells, with conditions, to an effect that costs zero "souls" to fire...no enchantment cost. I did this by attaching a script to the weapon (AddPerk simple script, conditioned to OnEquipped), the perk adds a single ability, that ability has the example script attached. This is the only way I could make the weapon's proposed ability to chop heads off and collect souls and not cost anything and still work.

 

That was my Vorpal Blade idea...which I have working in my load order.

 

Like I said ^.

Link to comment
Share on other sites

 

Just a quick question. How do I make an introductory conversation that an npc will go through once when you meet them?

 

I swear I thought I knew, but I can't seem to replicate what I did.

You can make a global that normally == 0 and then check that in the introduction, and set it to 1 when done, with the other convos conditioned to == 1.

 

Or, if you're not using stages for something else in the quest, set a stage after first convo and use GetStageDone thatStage == 1.0 on all other convos and ==

0.0 on the first convo.

 

I tried doing the stage thing since the quest I was working in was just for npc dialogue and nothing else. I created two stages, 0 and 1. 0 being the startup stage. I created one branch, without a topic and set the condition for it GetStageDone (MyQuesthere) Stage 0 == 0.0. This branch linked to another branch that has the topic "What are you talking about (What the player will ask)" and once this branch completes I had a script that reads: GetOwningQuest().SetCurrentStageID(1) so that the quest will be set to stage 1, making stage 0 over.

 

Then there was a seperate branch (Topic "You're a lunatic"), not linked to anything that had the condition GetStageDone (MyQuesthere) Stage 0 == 1.0 like you said. The issue is when I went to test ingame the first branch never ran and "What are you talking about" and "You're a Lunatic" were both available.

 

My thoughts on the issue: I have some Hellos the npc says when you talk to him. Maybe I need to make those only show up if the stage is 1? Might be what I need to do. Maybe.

 

Or perhaps you know? Thanks for the help in advance.

Link to comment
Share on other sites

 

 

Just a quick question. How do I make an introductory conversation that an npc will go through once when you meet them?

 

I swear I thought I knew, but I can't seem to replicate what I did.

You can make a global that normally == 0 and then check that in the introduction, and set it to 1 when done, with the other convos conditioned to == 1.

 

Or, if you're not using stages for something else in the quest, set a stage after first convo and use GetStageDone thatStage == 1.0 on all other convos and ==

0.0 on the first convo.

 

I tried doing the stage thing since the quest I was working in was just for npc dialogue and nothing else. I created two stages, 0 and 1. 0 being the startup stage. I created one branch, without a topic and set the condition for it GetStageDone (MyQuesthere) Stage 0 == 0.0. This branch linked to another branch that has the topic "What are you talking about (What the player will ask)" and once this branch completes I had a script that reads: GetOwningQuest().SetCurrentStageID(1) so that the quest will be set to stage 1, making stage 0 over.

 

Then there was a seperate branch (Topic "You're a lunatic"), not linked to anything that had the condition GetStageDone (MyQuesthere) Stage 0 == 1.0 like you said. The issue is when I went to test ingame the first branch never ran and "What are you talking about" and "You're a Lunatic" were both available.

 

My thoughts on the issue: I have some Hellos the npc says when you talk to him. Maybe I need to make those only show up if the stage is 1? Might be what I need to do. Maybe.

 

Or perhaps you know? Thanks for the help in advance.

 

GetStageDone for stage 0 is not right - it's the first stage, it's automatically done, so what you did won't work. It should be GetStageDone myQuest 1 (stage 1) == 0.0, and the other topics being GetStageDone myQuest 1 (stage 1) == 1.0, setting stage to 1 when the first branch is done. Nothing should be conditioned to 0, it's already done, done means that the stage has been set to that stage - that marks it as "done". If it starts at 0, it's on that stage, so it's done.

Link to comment
Share on other sites

 

GetStageDone for stage 0 is not right - it's the first stage, it's automatically done, so what you did won't work. It should be GetStageDone myQuest 1 (stage 1) == 0.0, and the other topics being GetStageDone myQuest 1 (stage 1) == 1.0, setting stage to 1 when the first branch is done. Nothing should be conditioned to 0, it's already done, done means that the stage has been set to that stage - that marks it as "done". If it starts at 0, it's on that stage, so it's done.

 

 

Alright! Everything's almost working great! The only issue now is that instead of jumping right into his "greeting" he says Hello and to get to his greeting you have to choose a dialogue option of "..."

 

I want him to jump straight to his "greeting" dialogue when you first talk to him. Is there a way to do this within Dialogue Views or would I just need to make this dialogue a "Hello" in Misc and make it so that all the other hellos are stage-dependent, which would probably work.

 

Just trying to find the easier way.

Link to comment
Share on other sites

 

 

GetStageDone for stage 0 is not right - it's the first stage, it's automatically done, so what you did won't work. It should be GetStageDone myQuest 1 (stage 1) == 0.0, and the other topics being GetStageDone myQuest 1 (stage 1) == 1.0, setting stage to 1 when the first branch is done. Nothing should be conditioned to 0, it's already done, done means that the stage has been set to that stage - that marks it as "done". If it starts at 0, it's on that stage, so it's done.

 

 

Alright! Everything's almost working great! The only issue now is that instead of jumping right into his "greeting" he says Hello and to get to his greeting you have to choose a dialogue option of "..."

 

I want him to jump straight to his "greeting" dialogue when you first talk to him. Is there a way to do this within Dialogue Views or would I just need to make this dialogue a "Hello" in Misc and make it so that all the other hellos are stage-dependent, which would probably work.

 

Just trying to find the easier way.

 

Make it a blocking branch.

Link to comment
Share on other sites

Ok made a bit of headway.

 

This item/object now can be hit with my sword, and it will explode and become disabled. However, as many scripts as I try, I can't set a stage from the item exploding on hit, any pointers?

Thye reason why I am trying to set a stage is I can move the player with ease from the combat zone. Maybe there's another way to move the player without a setstage?

Link to comment
Share on other sites

Here's an interesting question that my roommate made me think of... Would it be possible to make it so when you go to use a workstation (forge, enchanter, etc.), it will have access to materials you've put in a container without having to move those items to the player temporarily?

No. The game always looks at your inventory and there's no way to change that.

Link to comment
Share on other sites

 

Make it a blocking branch.

 

 

Yes! That worked perfectly! I knew there was an easier way. Thanks for the link as well. I was looking for something like that but couldn't find it with a mere google search for some reason.

 

Thankyou! Now I can finally get some real headway on my mod.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...