Jump to content

Need help gettin a hazard to spawn ammo


Joolander

Recommended Posts

Hey everyone

 

So my mod Torch Arrows is a WIP at the moment

 

Currently, when the arrows hit something, they create an explosion (invisible) which spawns a hazard which lights up the area and sets any enemies that touch it on fire

 

This is great gameplay-wise, but the arrow seems to disappear on impact (I believe this is due to how explosive projectiles work)

 

So what I would like to do is have the Hazard spawn a copy of the ammo at the point of impact. Is there a way to make a magic effect that does this?

 

I've already tried editing the displayed *.nif of the hazard, but there seems to be no way that I can find to make it face the right way in the world space (see attached pictures: all were taken facing the direction the arrow was fired)

 

http://i.imgur.com/Zix4C.jpg

http://i.imgur.com/Hk2jF.jpg

http://i.imgur.com/2VSl1.jpg

Edited by Joolander
Link to comment
Share on other sites

Your explosion form actually has a field in it that allows you to specify that something be spawned on impact, like another explosion or light, or any other object. I just checked and arrows are included in the list of possible objects to spawn.
Link to comment
Share on other sites

Your explosion form actually has a field in it that allows you to specify that something be spawned on impact, like another explosion or light, or any other object. I just checked and arrows are included in the list of possible objects to spawn.

 

First of all, thank you for the reply :)

 

Secondly, currently that field is being taken up by a hazard (a fire that puts DOT on enemies that walk through it). This hazard is the entire point of the arrow, I can't get replacle it, otherwise the mod is pointless.

 

The hazard does use a spell to damage the target. I have tried including a magic effect in the spell that spawns an arrow, but I can't seem to get it working at all. It seems none of the options for Effect Archetypes will let you spawn or summon an object

 

is this something that can be done with scripts? I have no Idea where to begin if it does

Link to comment
Share on other sites

Well, here is what I would try doing:

 

Instead of having your explosion spawn the hazard, have it spawn a marker. You might need to make a special activator marker for yourself so you can attach a script to it.

 

Put an OnLoad event script on the marker that spawns the hazard & also spawns the arrow at 'self'.

 


Hazard property MyHazardProperty auto
Projectile property MyArrowProperty auto

Event OnLoad()

   self.PlaceAtMe(MyHazardProperty,1)
   self.PlaceAtMe(MyArrowProperty,1)
   self.Delete()

EndEvent

 

You may also end up needing to script the duration of the Hazard, I suppose.

 

Let me know if it works out for and/or if you need a better explanation of what I'm on about.

Link to comment
Share on other sites

Well, here is what I would try doing:

 

Instead of having your explosion spawn the hazard, have it spawn a marker. You might need to make a special activator marker for yourself so you can attach a script to it.

 

Put an OnLoad event script on the marker that spawns the hazard & also spawns the arrow at 'self'.

 


Hazard property MyHazardProperty auto
Projectile property MyArrowProperty auto

Event OnLoad()

   self.PlaceAtMe(MyHazardProperty,1)
   self.PlaceAtMe(MyArrowProperty,1)
   self.Delete()

EndEvent

 

You may also end up needing to script the duration of the Hazard, I suppose.

 

Let me know if it works out for and/or if you need a better explanation of what I'm on about.

 

Not trying to be dense, but I'm going to need a better explanation of how to go about this. I played around with activators, but I dont have no Idea how to attach a script to it

Link to comment
Share on other sites

Ah, well, I would check out the CK wiki in that case. Here is the page that lists all the entries in an Activator form:

 

http://www.creationkit.com/Activator

 

There is already an 'xMarkerActivator' in vanilla SKYRIM's list of activators. Open that up and rename it's ID for yourself to create your new marker, which you can then attach the script to.

Link to comment
Share on other sites

ok, finally figured it out, kind of

 

heres what I got

 

http://i.imgur.com/ay5qT.jpg

 

turns out, if you spawn a projectile, if you try to pick that up from the ground , you get a CTD

 

but it works fine as ammo

 

 

anyway, now I have a big problem, a small problem, and a question

 

Big problem: the hazard spawns, (I know because I can see the fire) but it does not actually harm anyone (enemies and the player can walk right through the fire) I think this is because it has no "owner"? is there a way to make the owner whoever fired the original arrow?

 

small problem: if the arrow hits someone, they will have an arrow sticking out of them (the fired arrow), and an arrow laying at their feet (the script-spawned arrow). is there a way to make the script only spawn an arrow if an actor was not hit?

 

question: is there a way to make the hazard not spawn if the arrow lands in water?

 

oh yeah one more question: the activator is deleting itself after spawning the arrow, right? so there shouldn't be save-game bloat? or would a bunch of spawned arrows laying around cause that?

Edited by Joolander
Link to comment
Share on other sites

Big Problem: Hmm, since it worked fine before having been spawned from an explosion, try this: Make two 'explosions', one that spawns the activator, and another that spawns the hazard. Rather than have the activator spawn your hazard, have it spawn the second, 'real' explosion. I know for sure that you can spawn explosions in this way.

 

Small Problem: There is some script function I cannot recall right now that will clear the arrows that are sticking out of the NPC's 'for show', but I think they may still end up in the NPC's inventory. For my explosive arrow mod I made a scripted effect that was attached to the explosion that would look for that arrow in the inventory and delete it. I'm just saying, yes it is possible to remove the extra arrow. Not sure about knowing if the arrow hit a target actor or hit nothing... seems like there would be some way the game needs to keep track of that, though.

 

Question: No idea on this one, sorry. Again, there must be some way the game keeps track of whether objects should be floating or are submerged...

 

One more Question: Yes, the object is theoretically deleting itself. Since it is being created by a game mechanic and not being called as a property in any other script, it really SHOULD be deleting itself. It is possible, however, that it will not really delete itself until you leave the area it is in. Are you experiencing game bloat?

Link to comment
Share on other sites

I'm not experiencing save-game bloat, its just something I am trying very hard to avoid, as I see a lot of script heavy mods that apparently cause it. Or at least their comments sections claim that they do :P

 

anyway, I tried making the marker spawn a second explosion that spawns the hazard, and it didn't really change anything. the hazard still seems to not attack anyone

 

is there a script function that can ask who the owner is? or that can set the owner? like maybe GetOwner or something like that (I made that up. completely hypothetical name)

 

maybe there is a resource that has these things listed? I looked through the CK wiki and couldn't find anything other than vague information on scripting, no specifics. at least not as I understood them

Link to comment
Share on other sites

hang on

 

oil traps work by checking against a form list to see if something that can light it on fire has hit it

 

so can I add a bunch of water object to a formlist, check if thats what the arrow hit, and then have that be a condition on whether the fire hazard spawns?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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