Jump to content

a little help in (spell) Scripting...


maYuYang

Recommended Posts

Not as simple as one would expect, is it? :P

 

 

Yeah, great that there's no explanation in the readme or on the official hompage... But thank you for your quick reply^^.

 

Ok, I inserted the script, but CS didn't allow me to save it because it could't recognize PlayerCasting. I was looking on the OBSE Documentation, but couldn't find any replacement.

Also, by just removing those parts which contain PlayerCasting and leaving IsCasting only, the game will crash once you finished character creation..

You propably know a fix, do you^^? Just for my to understand:

 

if (IsCasting && PlayerCasting == 0)

set PlayerCasting to 1

if (HealingSelf == 1)

;Do horrible things to the player

endif

elseif (IsCasting == 0 && PlayerCasting == 1)

set PlayerCasting to 0

endif

 

set OldPlayerSpell to PlayerSpell

 

This part applies the disease, right? I suppose that the line"Do horrible things to the player" is where I have to set the Disease I want to use.

 

This weekend(yes, finally) I will start using Blender to create the spell effect. It's the 1st time I'm doing that, I'm quite curious(especially if it's very hard to do that, but there should be more than enough guides)

Link to comment
Share on other sites

Oh. The problem would be that I called it PlayerCasting in the script itself and declared it as CastingSpell... If you change "short CastingSpell" to "Short PlayerCasting" it should work fine. :sweat:

Do Horrible Things to the Player is indeed where you give them the disease, have the activator cast a spell on them, etc.

 

I don't actually think there are many guides for Blender Magic Effects out there...

Link to comment
Share on other sites

Hi again,

 

Ok, I was able to set up the script and added it as an ability. However, it didn't work, neither the Heal Damage nor the disease got applied....(using a healing spell will still heal)

if (IsCasting && PlayerCasting == 0)

set PlayerCasting to 1

if (HealingSelf == 1)

GetSpellType NABlackPlague

endif

elseif (IsCasting == 0 && PlayerCasting == 1)

set PlayerCasting to 0

endif

 

set OldPlayerSpell to PlayerSpell

 

Black Plague is the disease I created for this spell.

I will try it without the disease part once more, maybe that works better.

 

I don't think that healing is hardcoded, maybe there's a way around the effect by using GetSpellType "AnyDamageSpell", so you get more damage than you can heal, but again, I'm not sure if that would work since the Healing spells get stronger with skills and Levels...

Link to comment
Share on other sites

Ah, great^^ AddSpell works, thank you. Now I just need to test it alot, but the disease got applied which is already good.

 

Now I will start creating the AoE Debuff and another AoE Spell(maybe). I will use the CS wiki, but since their expanation is not always perfect, it might be that I will ask you more sooner or later.

 

Thank you for your patience, without you I wouldn't be able to learn so much about scripts^^

Link to comment
Share on other sites

Hi again^^,

 

Ok, I could do alot this weekend, but setting up the scripts was harder than I imagined.

I want to finish the scripts which are important for the new races 1st, so "only" 3 points:

 

1.) I started with this one myself, but there's one problem, I can't save it because CS says "Expected end in Line X" while X is the line with DAMiasmaSource.MoveTo me 0, 0, 0,

scn Miasmatic Aura

 

ref me

ref DAMiasmaSource

 

Begin ScriptEffectStart

ForceWeather clear

ForceWeather DAMiasmaticAtmo 1

end

 

Begin ScriptEffectUpdate

set me to GetSelf

DAMiasmaSource.MoveTo me 0, 0, 0,

DAMiasmaSource.Cast DAMiasmaEffect

End

 

Begin ScriptEffectFinish

ReleaseWeatherOverride

End

This spell should change the sky to DAMiasmaticAtmo, which works. It is also supposed to cast a AoE Spell called DAMiasmaEffect and this part doesn't seem to work.

 

2.) Abit more complicated: You remember my 1st request? The Heal Damage doesn't seem to work completely(Chara gains health instead of loosing it), but AddSpell seems to work(but not always). I want to change this spell, so if the player cast any heal spell, another spell gets applied too.

Something like

If PlayerCasting Heal

AddSpell X && AddSpell Y

I know the code is wrong, but I think you know what I mean^^.

 

3.) I have to admit that I didn't do any research for this one yet. There should be actually 2 points here:

a: A script for an Item, that Item should be unequipable and undisposable(I think this Item is necessary for the next part)

b: But once I use a spell, that Item gets auto-equiped and un-equiped after the time elapsed(as alternative, I thought of using "bound Item", but do not know if that would work with an amulet slot item...)

 

I however already learned alot about scripting and I want to thank you, LoginToDownload for your patience^^.

As you might guess, there's still much to do about the new races(yes, plural now). I think I'm at 30% atm. Once I finished more than half, I will also upload some pictures, so everyone can see what I was working on^^.

Link to comment
Share on other sites

1: It seems like the problem is the comma after the third 0. Commas are used to separate variables, so it confuses the game when there isn't a variable before and after. The "Cast" function also needs a target listed after the spell. (I imagine "me")

 

2: You'd just make it two different lines.

AddSpell X

AddSpell Y

For the gaining health instead of using it, you mean with ModAV2? Are you giving it a negative number? :confused:

 

3a: To avoid problems with unequipping it, you might look at the EquipItem function. Putting a "1" at the end will prevent the player unequipping it (including dropping) while still letting it be unequipped by script. You'd probably want to make it a Quest Item (no dropping) anyways to prevent a bug that crashes the game if a non-Quest-Item forcibly equipped to the player is removed via RemoveAllItems.

3b: It should work if you add it to the player in a ScriptEffectStart block, use a "timer" variable to wait a few frames and equip it afterwards in a ScriptEffectUpdate block, and remove it in a ScriptEffectFinish block.

 

As an aside, DA might not be the most convenient prefix to use, since the Daedric quests also make use of it. :)

Link to comment
Share on other sites

Hi Login^^,

 

Sorry, I have to corrigate myself. The Anit Heal script works perfectly^^, I had a longer testing session yesterday and can confirm that it works. I dunno why it didn't work in the imperial prison though, but I also think that one reason was an auto health recharge ability I removed again(that race would be rediculous strong with that). I will keep it that way, so thank you for helping me with this script. I could never have done it myself^^.

 

1.) I hope you're right, I will test it and tell you if that worked^^

 

2.) Happy, happy me, Yay^^. Your script works perfectly^^.

 

3.) Ahh, so Add it in start and remove it in finish, that's a good idea. I also have to add something so the player cannot unequip it for the time being. How do the timers look like? I guess that the Spell duration can be set in the normal spell effect selection window(like on the script I made, the effect remains for the spell duration only), but what about the timer you mentioned? On the CS Wiki, there're several examples on timers, but one seems to be for the scripteffectupdate only, while others seem to be quest or object relevant timers...

 

Ah, damn.. I forgot the daedric... DA is the shortcut of my mod and by adding that to everything I made in that mod, it's hard to remove every single one..... It might be a bad idea, but I will keep it and be very careful to not have one something with the same ID like the daedric things. Also it makes it much easier for me to searc for specific items I created... Oh well...

Link to comment
Share on other sites

3: The kind of timer I meant was basically a scripting variable you increase by 1 every frame/second until it reaches a certain value. So in this case, the script would go something like...

 

short timer

Begin ScriptEffectUpdate
 if (timer < 10)
	  set timer to timer + 1
 elseif (timer == 10)
	  set timer to 11
	  EquipItem MyItem
 endif
end

Link to comment
Share on other sites

hey there

 

i need some help with a scripted spell, hope someone can help me with that

 

i wanna create a spell with an arrow as projetlie, i have the arrow already but the problem is

i cant make it behave like an arrow...ballistic flying, stick in surfaces, pic up

 

...so i hope for support, thanks

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