Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Using scripts with spells.


Tchan
 Share

Recommended Posts

Mucking around with magic and learning about the effect and the spell. What im wanting to know is how to make a spell that is purely script based. Can someone give an example of one.

I tried writing my own, it was simple, OnHit it would give out a 'debug trace' but i never caught wind of it.

Nice site

Link to comment
Share on other sites

Spawn Dragon Spell. Only works outside.

1. Make the script and compile it.

The leveled actor object for the dragons is vanilla, so just auto-fill that.

Scriptname LevelersSpellDragonScript extends activemagiceffect  
{Summon Dragon high above player}

LeveledActor Property LCharDragonAny Auto
{Leveled Dragon}

Event OnEffectStart(Actor akTarget, Actor akCaster)
if Game.GetPlayer().IsInInterior()
else
Game.GetPlayer().PlaceAtMe(LCharDragonAny, 1)
endif
EndEvent
[/code]

2. Create a new >Magic >Magic Effect object.

Effect Archetype >Script

Add the script you created above to this object.

3. Create a new >Magic >Spell

Add the effect of the 'Magic Effect' object you created in #2 above.

When you cast the spell, it will run the script.

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

I don't mean to necro this but I'm super confused. I'm trying to make a summon spell with a custom monster I made, "00EncSUMMONGianttroll," and I try to substitute that giant troll string for "LCharDragonAny" but it always fails to compile the script. What's going on here?

 

Some of the conjuring spells wont work and I've kind of deduced what's going on but I don't know how to fix it. There are several beasts that absolutely wont summon unless you're standing in a very particular place near a very particular patch/type of ground. It's like the spell thinks that about 90% of summonable locations are illegal or invalid unless you just so happen to fire the spell at that one particular spot on the ground. Once the critter is actually summoned, everything works out just fine but actually successfully calling it forward is the trouble.

I want to try to use a script to force the thing to spawnatme because clearly the fire and forget is being mega picky for whatever reason.

Link to comment
Share on other sites

Is '00EncSUMMONGianttroll' a leveled list item? I have it defined that way in my script. Also, did you define your giant troll as a variable, and point to it in your script properties to the actual object in game?

LeveledActor Property LCharDragonAny Auto 

 

If its an actor then you need to change it to just 'actor'.

Link to comment
Share on other sites

Ohhh it is an actor... Interesting. This should help! It's been a headache trying to figure out why some monsters will summon and others wont. I dont think it's size because I can call up customized Giant Spiders and certain customized Giants in very tight quarters... but not others. The game handles reskins just fine but some physically modified giants/dragons are making the game unhappy. I'm hoping a spawnatme command will force them down.

Link to comment
Share on other sites

The properties you assign to each NPC must be of the correct type. If you want to point to an actor, you define it as an 'actor' type. If its a leveled actor, you point to a 'leveledactor' type. etc..

 

It must also be 'pointed' from the script to the actual game object (NPC) for it to work. Otherwise you get nothing.

 

Look at my first script tutorial for what I am talking about with properties and pointing them to game objects.

  • Upvote 1
Link to comment
Share on other sites

Yes. You must assign (or point) the NPC named variable (in the properties window) to the actual object you created. Scripts are NOT part of the CK, they are completely separate. So you have to say what the object is by defining it. and then pointing that definition to the actual object you made in the CK.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...