Jump to content

Crystal spells


PanzerOfGod

Recommended Posts

How do you make an item slowly ascend? My next spell will involve large crystals coming up from the ground in front of the player. Which reminds me, is there a way I could GetLOS or something to make sure that the crystal come up in the direction the player is facing?

Use player.getheading to determine where the player is facing. Use a script on the activator being created by the spell to move it into position by using an incremental

begin onload
if once != 1
set endposz to player.getposz
set once to 1
endif
if self.getpos z < endposz
set newz to self.getpos z + 2
self.setpos z newz
endif

or something similar. Just make sure the base point of the activator is a bit higher than where the bottom of the mesh is (difference of atleast 32 units), unless you want there to be a chance of a gap. While you could technically animate the activator to move instead, doing it this way would allow you to do another sort of animation on the activator (IE breaking when hit). Thought about doing something like this myself, but never got around to it. Should all be possible.

 

Thanks for the help Vagrant, but a bit of clarification;

 

1.I suppose by getheading you mean getheadingangle?

2.What script should the getheadingangle command go into? The same activator scipt?

And 3.With what command or string of commands should the activator be summoned?

 

Good luck, panzer! I'm going to download this.

 

Thanks, chris, but I won't upload until I finish this spell and at least two others.

 

 

 

 

Edit: I need one more bit of information; how do I get a reference to an attacking npc? Also, I want to know: if the attack happens to be a spell or arrow, will the reference still be on the npc, and not the spell/arrow?

Link to comment
Share on other sites

Getheadingangle would have to be in the spell effect to get the position of where to create the activator. Although now that I think about it, the implementation might be a bit wrong, if you don't want to keep on moving a persistant activtor around, you would have to use the getheadingangle to place an invisible activator somewhere, then have that activator use a placeatme. Otherwise, if you use a placeatme to both create and position the wall in front of the player, you would need additional steps to move the wall below view, then rise. Unfortunately you can't directly create something at specific coordinates, and don't think you can move a marker, then use the marker as the calling reference for a placeatme. Think this is one of the reasons I never got around to doing this, too much time figuring out positioning stuff.

 

As for getting the reference of something attacking the player, you really can't, not in any effective way atleast. Basically, you would need something to cast an invisible area effect spell which would contain "if self.getiscombattarget player" followed by some actions. Unfortunately, this pings everything within the radius (creates some slow down if you are performing this check often), and any actions to be performed have to be executable from that spell effect. While sopposedly you can declare a reference ID within a quest script from another script "set questname.reference to getself" or something similar, but I've never gotten it to work.

 

As far as I know, you can't get the reference for any spell or arrow through any means.

Link to comment
Share on other sites

This all sounds very complex... But please give me your honest opinion; is this drawing possible:

 

o = player, ^ = crystal, e = enemy, -- = enemy spell, \ = enemy spell ricochet, _ = a space, don't pay it attention

 

 

_____^

______^

___o___^---------------e

______^ \

_____^ _ \

_________\

 

 

 

 

That was the original vision I had when thinking up the spell. The player casts a spell which places a semi-circle of crystals in front of him/her, no matter what direction they're facing in. When hit, these crystals would have an effect on the attack. I hadn't thought of what I wanted the effect to be, maybe bouncing the attack away like in the drawing, maybe an explosive blast on hit. The main thing is the crystals though. I need to know a script that would force a number of objects to appear in set positions relative to the player.

Link to comment
Share on other sites

_____^

______^

___o___^---------------e

______^ \

_____^ _ \

_________\

Probably possible, but would require an obscene amount of scripting. Also wouldn't work too well in tight spaces. The reflect however would require a seperate target somewhere since essentially it would be the crystal being hit casting the same spell (or atleast one that looks similar) at that target (think this is how that reflect shield mod works).

 

As for the other spell...

scn whatever

ref self

begin script effect start
set self to getself
self.modav fatigue -5000
self.setrigidbodymass 100
end

begin scripteffect update
self.modav fatigue -10
end

begin scripteffectfinish
self.setrigidbodymass 60
self.modav fatigue 6000
end

 

or something similar should probably work how you want. If you use a paralyze effect, you don't need to use the fatigue adjustments. You do however need some way of making that NPC go limp before you can use setrigidbodymass to make them stiff.

Link to comment
Share on other sites

Thanks vagrant, I'll try that out once I work out the rest of the script. Speaking of which, is there a way for a script that's placed on an activator to set a reference for an NPC that's close to it? What that freeze spell will do is place a crystal at an enemy and have the crystal constantly cast a weak shock spell at the enemy, making it look like the shock spell is what's paralyzing the enemy.

 

Edit:How very odd... I put that script you gave me on the spell. If the enemy I cast it on is in battle, they fly in the air, limbs stretching and twisting every which way, before stopping completely in mid-air, usually with their head far away from their body. Maybe I'll rework the spell but keep this version as a joke that the player will have to discover. At any rate, I don't know if you meant it to be this way, but when the spell doesn't mutilate the enemy, it makes them simply fall to the ground. When I said freeze, i meant completely stop in place, still standing/sitting/whatever they were doing.

Link to comment
Share on other sites

Thanks vagrant, I'll try that out once I work out the rest of the script. Speaking of which, is there a way for a script that's placed on an activator to set a reference for an NPC that's close to it? What that freeze spell will do is place a crystal at an enemy and have the crystal constantly cast a weak shock spell at the enemy, making it look like the shock spell is what's paralyzing the enemy.

 

Edit:How very odd... I put that script you gave me on the spell. If the enemy I cast it on is in battle, they fly in the air, limbs stretching and twisting every which way, before stopping completely in mid-air, usually with their head far away from their body. Maybe I'll rework the spell but keep this version as a joke that the player will have to discover. At any rate, I don't know if you meant it to be this way, but when the spell doesn't mutilate the enemy, it makes them simply fall to the ground. When I said freeze, i meant completely stop in place, still standing/sitting/whatever they were doing.

Alone, scripts can only get references from things which are known or were the original target of the effect. The script on the activator wouldn't be able to cast a spell of any NPC nearby since that NPC is unknown. Likewise, if you're using a non-persistant activator, you wouldn't be able to have the spell effect tell the activator to cast a spell on the target that script is running on, unless that script named that reference when it was created. The more unknownn references you need to use, the more complicated the script needs to be. In short, your idea is possible, but it wouldn't be any scripting on the activator doing this since the activator wouldn't be able to get the reference of the target. Instead you need to use the spell effect to tell the activator to cast a spell at the NPC.

 

As for the effect, it wasn't planned like that, but that effect is consistant with when things have their fatigue lowered suddenly. Might want to try adding a paralyse effect to the spell instead. Or setting the NPC as restrained, waiting a few frames, then reducing the fatigue below 0 so that the setrigidbodymass part becomes effective. You will however be unable to freeze people how they are, anything which would make them become frozen like that would also break any animation bindings (such as sitting).

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