Jump to content

Help getting script to work that casts spell from the sky


Recommended Posts

Been stuck on this a few days now, this is my last ditch effort before I end up changing what I’m going for to make it easier. I really cannot script, everything I’ve gotten has been from those who would help or mods with open permissions. I also looked into the vanilla dragon meteor shout script, but it was beyond me to utilise it.

 

 

My aim is for a scenario like this: your playing Skyrim, you see an enemy camp about a minute walk away, you equip an explosion spell and aim it at the camp, a spell is cast down from the sky at wherever you aimed, and all the enemies are gone.



This is what I have to work with currently, it won’t compile, and even if it does I’m not certain it will work, it also doesn’t have anything preventing the player from casting in interiors, which while I’m not against, would probably break the game if it were allowed. Any and all help getting this working as hoped would be amazing.

 

```Scriptname Megexp2script extends activemagiceffect  

spell property Megexpspell
activator function castingpoint
inv property Height
Float property RandomXY auto
Float Xvar
Float Yvar

Actor Target

Event OnEffectStart
Target = akTarget

cordX = target.getposX
cordY = target.getposY
cordZ = target.getposZ

castingpoint.moveto(cordX, cordY, (cordZ + Height))
Megexpspell.cast(castingpoint, target)

Endevent```

And here’s the current compiling error, I’m expecting they’ll be more before this is over.

 

```Starting 1 compile threads for 1 files...
Compiling "Megexp2script"...
Megexp2script.psc(6,31): mismatched input '\\r\\n' expecting LPAREN
Megexp2script.psc(0,0): error while attempting to read script Megexp2script: Object reference not set to an instance of an object.
No output generated for Megexp2script, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.```

 

Sorry for any lack of clarity, I’m at my wits end with it.

 

 

Edited by link182
Spelling mistake
Link to comment
Share on other sites

"activator function castingpoint"

??!?

Getting started on scripting is difficult and frustrating. Don't let these small difficulties stop you. They're a normal part of programming and you'll soon develop the habits and discipline to spot them and fix them. Been programming for many decades, and my initial drafts often look like that too.
Link to comment
Share on other sites

To be honest I’ll probably just go a different and easier route, I looked at the astral magic 2 mod for inspiration and it seems near impossible to replicate when I’ve tried. It’s a shame, but I just don’t have the patience for it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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