Jump to content

a little help in (spell) Scripting...


maYuYang

Recommended Posts

Hi again,

 

I hope you're not too annoyed about my never ending questioning(will be less and less I think. I seem to understand way more than in the beginning^^).

 

1.) I tested the AoE DeBuff yesterday, but it didn't seem to work. I will overwork the script abit more, I have some ideas how to improve it. there's but one thing I noticed, Aggro. Since the Activator is casting the AoE, the NPCs will not turn aggressive against the actually casting player. In the UESP CS Wiki, I learned that this feature is yet incomplete, but there are some work arounds(I'm thinking to allow that spell only if the target is already in combat. That would also fit to the nature of this spell).

Do you know any threat generating scripts against several NPCs?

 

2.) I need some sort of race check. Some of the spells should be race/npc only, so the player cannot receive(or activate) them with cheating. My idea was GetIsRace RaceID, but not sure if that would do the trick.

I couldn't find any code for NPC only...

 

 

2 Last questions: I guess there's a code which would make the player float over the floor. I'm actually planning making such animations with Blender since it seems to be easier than I thought(animations at least). Searching on the CS Wiki for float was a bad idea(so many scripts use fload as reference to numbers, gosh..), so I wanted to ask you for that.

 

Last but not least, about X.MoveTo me 0, 0, 0

I guess the zeros stand for x, y, z in that order. What I was wondering about is where exactly is 0, 0, 0? Under the players feet? Or right in the middle of the player? Also, what kind of distance are those variables? I guess it's neither feet nor meters...

 

 

@nasaedo

sorry for my late reply. I'm still learning myself, but I think a magical bow would be possible with OBSE. However, I doubt it would be a direct spell, more like an enchantment or maybe magical arrows themself. I also think that later ones are easier to bring into the game by making them with blender and adding a FX to the arrows. So you have some sort of magical ammunition(or using an OBSE spell to temporally exchange normal arrows with those Blender ones). The Enchantment... Well I think(and I want to make clear that I really could be wrong) that an enchantment is only possible for the bow itself. Enchanting an arrow would propably cause the visual enchantment effect not to follow the shot arrow.

But as I said, I'm still learning, so I could be wrong.

Link to comment
Share on other sites

1: Usually people use SendTrespassAlarm combined with StartCombat or ForceTakeCover depending on the victim's Aggression/Confidence, attaching it all to a Script Effect for such things. It's far from perfect, though.

 

A much more effective but rather processor-heavy method, using newer OBSE functions, is to cast the projectile high enough above the player that it has a frame before exploding, and use a combination of GetFirstRef, GetNextRef, GetProjectileType, GetProjectileSource, and SetPlayerProjectile to find the projectile in question and set its "source" to the player. A sample of its usage can be found under Projectile Functions. I can't guarantee how consistently once could position the projectile in open space, though.

 

If you only wanted to use it on people fighting the player, you might look into IsInCombat and GetCombatTarget/GetShouldAttack, make the "original" AoE debuff you cast on the player only a Script Effect, and cast a non-AoE "real" debuff on those who were affected by the first one and are fighting the player.

 

2: I'm pretty sure GetIsRace RaceID would work fine.

 

2 Last questions: I guess there's a code which would make the player float over the floor. I'm actually planning making such animations with Blender since it seems to be easier than I thought(animations at least).
Ooo, maybe you can teach me at one point. :D

Do you mean floating like an imp or lich, or actually being unaffected by the ground's position?

 

Oblivion troublesomely has its own measurement of units that that uses. They are indeed X/Y/Z, and I think 0, 0, 0 is the lowest possible spot that could be considered "the actor". If a spell one's casting from there doesn't have an Area of Effect, it won't actually hit the target unless you make 0, 0, 10 or such.

 

Nasaedo: I've seen two methods of casting a spell to fire arrows. One of them actually makes the projectile an activator, uses trigonometry to place the arrow directly in front of the player, and the same trigonometry to determine in which direction it should move. I never quite figured out how they detected collision, though... I find these methods also tend towards the buggy, and their movement a significantly simpler version of that of "proper" arrows. Examples of it can be found in Midas Magic and Arcanery.

The other method is just to place a completely invisible, silent, and invulnerable actor with a bow and arrow in front of the player, and have it start combat with the spell's victim (or target found through other means, like an AoE spell), then whisking it away after a few seconds/an arrow hits. The downsides to this method naturally being that it takes a brief while after the initial casting to fire the arrow, and that the player can't "aim" it like they do their own spells/arrows.

You could also "cheat" by having the spell equip an invisible and lightning-fast bow to the player along with an arrow, and have the player wind up and fire as appropriate with GetControl/GetAltControl, HoldKey, and ReleaseKey.

Link to comment
Share on other sites

"Sigh", For some reason my scripts don't want to work correctly...

 

1.) I used IsInCombat, but I still could use that spell, not to mention that the AoE effect didn't work at all. I also inserted:

set me to GetSelf

if me == player

return

endif

But since the AoE effect didn't even kick in, I could not test this. To top it all off, the ReleaseWeatherOverride didn't work for some reason(the weather effect remains untill you quit or load another game). I will propably change my priority to the blender effects 1st...

 

2.) Is there also a code which allows a spell or an item to an actorID only? So if let's say NPC Ayame has the spell Ultima, the player can't use or get this specific Spell via cheats? Maybe GetIsActor ActorID?

 

3.) I mean floating like an Imp. "Unaffected by the ground" would be like flying? I mean like in the Avariel Race mod, right?

 

1 cont.) the problem I seem to have is that the activator spells I create do not work for some reason(as tutorial, I used this example). Otherwise, I would just goof around with x, y, z to see where my spell actually lands. My 1st idea about that AoE spell was that it happens somewhere below me and cannot hit the NPCs, but it didn't work also when I changed the z variable to 10 and later to 100. Do you think that like in that tutorial, my script has to activate another script which will cast the spell? I ordered my script to cast the spell directly...

 

4.) I think that you're much more advanced with Blender than me^^. I'm still at the beginning. A friend just said that using it for animations is actually quite easy after some trial and error parts. But I would love to help you out once I figure out how to use it^^.

Link to comment
Share on other sites

1: Sounds like it's bugtesting time... Try scattering messages throughout your spell script and see which ones run. You can also test the "if me == player" one that way, if you put the message before the return.

All I know about weather-functions is what's visible on the CS Wiki, but looking at Midas Magic, it doesn't seem like ReleaseWeatherOverride would instantly switch the weather back. What happens if you Wait or leave/enter the cell? (or a combination of both)

Midas Magic seems to get around it by saving the game's previous weather-state and switching it back after ReleaseWeatherOverride without an override flag.

 

1 cont: I've occasionally experienced a problem where you can only move an object once into the game, and trying to move it again won't do anything, which I always got around by disabling it and moving it to the holding cell in-between, but at least then it would work the first time, and that only ever happened with visible objects... Never TrigZones and such.

 

2: I don't quite understand what you mean, (Is the player only restricted from casting it if Ayame has the spell, or no matter what?) but it sounds like you've already found the method up top. (If me == WhateverRef) The player would still cast it, but you could stop it doing anything with that. It's also probably worth noting that NPCs need a special incentive (like an additional "normal" effect that's pertinent to the situation or forced via the Cast function) to cast scripted spells.

 

3: I'm confused... Partly because all I know about the Avariel are that they're elves that fly, and that I know next to nothing about animations. However, it might be worth mentioning that by the Imp method of flight, they're still bound to that exact same spot above the ground, take falling damage, (though that's very easy to fix) and will hurt themselves if they "fly over" floor-spikes.

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