Jump to content

Crystal spells


PanzerOfGod

Recommended Posts

I am currently creating a mod with crystal-themed spells. Right now, I have only two spells, but they need a bit of work. One of my spells moves a crystal over my head and casts a lightning AOE spell. For some reason, the crystal becomes invisible if I cast the spell outdoors. I think it has to do with the use of my moveto player command in the spell's script. I have the crystal that the spell uses placed in a dummy cell for later use by the spell. What I want to know is, is there a way to use the placeatme command and then somehow target the crystal at the end of the spell effect so I can use removeme and disable?
Link to comment
Share on other sites

Here is the script for another one of my spells:

 

Scriptname SMCSmallImpureCrystalSpellScript

Ref EvilCrystal01
Ref EvilCrystal02
Ref EvilCrystal03
Ref EvilCrystal04
Ref EvilCrystal05
Ref EvilCrystal06
Ref EvilCrystal07
Ref EvilCrystal08
Ref EvilCrystal09
Ref EvilCrystal10
Ref EvilCrystal11
Ref EvilCrystal12
Ref EvilCrystal13
Ref EvilCrystal14
Ref EvilCrystal15
Ref EvilCrystal16
Ref EvilCrystal17
Ref EvilCrystal18
Ref EvilCrystal19
Ref EvilCrystal20
Float Timer

Begin ScriptEffectStart
Set Timer to GetSecondsPassed
Set EvilCrystal01 to Player.PlaceAtMe SMCCrystalRotationTest
If (Timer == .5)
Set EvilCrystal02 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 1)
Set EvilCrystal03 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 1.5)
Set EvilCrystal04 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 2)
Set EvilCrystal05 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 2.5)
Set EvilCrystal06 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 3)
Set EvilCrystal07 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 3.5)
Set EvilCrystal08 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 4)
Set EvilCrystal09 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 4.5)
Set EvilCrystal10 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 5)
Set EvilCrystal11 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 5.5)
Set EvilCrystal12 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 6)
Set EvilCrystal13 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 6.5)
Set EvilCrystal14 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 7)
Set EvilCrystal15 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 7.5)
Set EvilCrystal16 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 8)
Set EvilCrystal17 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 8.5)
Set EvilCrystal18 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 9)
Set EvilCrystal19 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
If (Timer == 9.5)
Set EvilCrystal20 to Player.PlaceAtMe SMCCrystalRotationTest
EndIf
End

Begin ScriptEffectFinish
EvilCrystal01.Disable
EvilCrystal01.RemoveMe
EvilCrystal02.Disable
EvilCrystal02.RemoveMe
EvilCrystal03.Disable
EvilCrystal03.RemoveMe
EvilCrystal04.Disable
EvilCrystal04.RemoveMe
EvilCrystal05.Disable
EvilCrystal05.RemoveMe
EvilCrystal06.Disable
EvilCrystal06.RemoveMe
EvilCrystal07.Disable
EvilCrystal07.RemoveMe
EvilCrystal08.Disable
EvilCrystal08.RemoveMe
EvilCrystal09.Disable
EvilCrystal09.RemoveMe
EvilCrystal10.Disable
EvilCrystal10.RemoveMe
EvilCrystal11.Disable
EvilCrystal11.RemoveMe
EvilCrystal12.Disable
EvilCrystal12.RemoveMe
EvilCrystal13.Disable
EvilCrystal13.RemoveMe
EvilCrystal14.Disable
EvilCrystal14.RemoveMe
EvilCrystal15.Disable
EvilCrystal15.RemoveMe
EvilCrystal16.Disable
EvilCrystal16.RemoveMe
EvilCrystal17.Disable
EvilCrystal17.RemoveMe
EvilCrystal18.Disable
EvilCrystal18.RemoveMe
EvilCrystal19.Disable
EvilCrystal19.RemoveMe
EvilCrystal20.Disable
EvilCrystal20.RemoveMe
End

 

The problem is that only one of my SMCCrystalRotationTest Crystals actually appears when I cast the spell. I assume the problem is with the timer. I've never used a timer in a script before, so I don't know what I'm doing. I just need to know a way to make things appear after specific intervals of time (in this case the time is .5 seconds, but I'll most likely be changing that later).

Link to comment
Share on other sites

GetSecondsPassed returns the time since the last frame the script ran in. Therefore, you need to add it ti timer. Also, you should be checking if it's in a range, rather than at an exact point.

 

You will also need to check if a specific crystal has been placed yet. A counter that's incremented each time a crystal is placed should work for this.

Link to comment
Share on other sites

  Abramul said:
GetSecondsPassed returns the time since the last frame the script ran in. Therefore, you need to add it ti timer. Also, you should be checking if it's in a range, rather than at an exact point.

 

You will also need to check if a specific crystal has been placed yet. A counter that's incremented each time a crystal is placed should work for this.

 

So your saying I should use "Set timer to timer + GetSecondsPassed" instead of "Set timer to GetSecondsPassed"?

 

I also don't understand what you mean by checking if it's in a range... I don't know how to increment a counter either... Sorry, I don't know all too much about scripting. Part of the point of this mod is too learn a bit more.

 

Edit:I'm going to elaborate a bit on what this spell eventually needs to do.

 

I have it scripted so that these specific crystals rotate around the player. I want this spell to call these crystals one by one to the player at intervals so that after a short while, the player is surrounded by a constantly spinning circle of crystals. I'm going to make it so that when something collides with the crystals, it gets hit with a fire spell. Since the script I use for rotation inevitably disables the rotating objects' collision, I will have to create a circular triggerzone that moves with the player cast the fire spell instead, and not at the player; not an overly difficult task. All this would be done by now if I only knew how to put time between each placement of a crystal around the player. That's all I need to know.

Link to comment
Share on other sites

Something along these lines. Note that I'm not actually doing this in the CS, and therefore there may be an error or two.

short counter
float timer
if counter == 0
  if timer >= 0 && timer < 1
 ;do step one
  set counter to counter + 1
  endif
endif
if counter == 1
  if timer >= 1 && timer < 2
 ;do step two
  set counter to counter + 1
  endif
endif
if counter == 2
  if timer >= 2 && timer < 3
 ;do step three
  set counter to counter + 1
  endif
endif
if counter == 3
  if timer >= 3
 ;do final step
  set counter to counter + 1
  endif
endif
if timer <= 3
  set timer to timer + GetSecondsPassed
endif

Link to comment
Share on other sites

Integrating that script within my own, I now have this:

 

Scriptname SMCSmallRotatingImpureCrystalSpellScript

Ref EvilCrystal01
Ref EvilCrystal02
Ref EvilCrystal03
Ref EvilCrystal04
Ref EvilCrystal05
Ref EvilCrystal06
Ref EvilCrystal07
Ref EvilCrystal08
Ref EvilCrystal09
Ref EvilCrystal10
Ref EvilCrystal11
Ref EvilCrystal12
Ref EvilCrystal13
Ref EvilCrystal14
Ref EvilCrystal15
Ref EvilCrystal16
Ref EvilCrystal17
Ref EvilCrystal18
Ref EvilCrystal19
Ref EvilCrystal20
Short Counter
Float Timer

Begin ScriptEffectStart
If (Counter == 0)
If (Timer < .4)
	Set EvilCrystal01 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 1)
If (Timer > .4 && Timer < .7)
	Set EvilCrystal02 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 2)
If (Timer > .8 && Timer < 1.1)
	Set EvilCrystal03 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 3)
If (Timer > 1.2 && Timer < 1.6)
	Set EvilCrystal04 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 4)
If (Timer > 1.7 && Timer < 2.1)
	Set EvilCrystal05 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 5)
If (Timer > 2.2 && Timer < 2.6)
	Set EvilCrystal06 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 6)
If (Timer > 2.7 && Timer < 3.1)
	Set EvilCrystal07 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 7)
If (Timer > 3.2 && Timer < 3.6)
	Set EvilCrystal08 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 8)
If (Timer > 3.7 && Timer < 4.1)
	Set EvilCrystal09 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 9)
If (Timer > 4.2 && Timer < 4.6)
	Set EvilCrystal10 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 10)
If (Timer > 4.7 && Timer < 5.1)
	Set EvilCrystal11 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 11)
If (Timer > 5.2 && Timer < 5.6)
	Set EvilCrystal12 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 12)
If (Timer > 5.7 && Timer < 6.1)
	Set EvilCrystal13 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 13)
If (Timer > 6.2 && Timer < 6.6)
	Set EvilCrystal14 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 14)
If (Timer > 6.7 && Timer < 7.1)
	Set EvilCrystal15 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 15)
If (Timer > 7.2 && Timer < 7.6)
	Set EvilCrystal16 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 16)
If (Timer >7.7  && Timer < 8.1)
	Set EvilCrystal17 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 17)
If (Timer > 8.2 && Timer < 8.6)
	Set EvilCrystal18 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 18)
If (Timer > 8.7 && Timer < 9.1)
	Set EvilCrystal19 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Counter == 19)
If (Timer > 9.2 && Timer < 9.6)
	Set EvilCrystal20 to Player.PlaceAtMe SMCCrystalRotationTest
	Set Counter to Counter + 1
EndIf
EndIf
If (Timer > 9.7)
Set Timer to Timer + GetSecondsPassed
EndIf
End

Begin ScriptEffectFinish
EvilCrystal01.Disable
EvilCrystal01.RemoveMe
EvilCrystal02.Disable
EvilCrystal02.RemoveMe
EvilCrystal03.Disable
EvilCrystal03.RemoveMe
EvilCrystal04.Disable
EvilCrystal04.RemoveMe
EvilCrystal05.Disable
EvilCrystal05.RemoveMe
EvilCrystal06.Disable
EvilCrystal06.RemoveMe
EvilCrystal07.Disable
EvilCrystal07.RemoveMe
EvilCrystal08.Disable
EvilCrystal08.RemoveMe
EvilCrystal09.Disable
EvilCrystal09.RemoveMe
EvilCrystal10.Disable
EvilCrystal10.RemoveMe
EvilCrystal11.Disable
EvilCrystal11.RemoveMe
EvilCrystal12.Disable
EvilCrystal12.RemoveMe
EvilCrystal13.Disable
EvilCrystal13.RemoveMe
EvilCrystal14.Disable
EvilCrystal14.RemoveMe
EvilCrystal15.Disable
EvilCrystal15.RemoveMe
EvilCrystal16.Disable
EvilCrystal16.RemoveMe
EvilCrystal17.Disable
EvilCrystal17.RemoveMe
EvilCrystal18.Disable
EvilCrystal18.RemoveMe
EvilCrystal19.Disable
EvilCrystal19.RemoveMe
EvilCrystal20.Disable
EvilCrystal20.RemoveMe
End

 

It compiles correctly, but only one crystal appears ingame just like before. Did i do something wrong?

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...