kire12 Posted August 2, 2008 Share Posted August 2, 2008 Im currently in the thralls of creating a custom class and quest string for it, but my main focus is the way this class will cast spells. What I'm hoping to find out is: Is there a way to script a compenent neccessity (such as an item must be in the inventory for it to cast at all) which after the spell is cast removes the item from you're inventory, and (this is where it would get VERY tricky imo) then after a set amount of time replace the item in you're inventory. As in say for example 5 seconds after the spell is casts it adds the item back to you're inventory. The script would have to allow for spells to be self/target/touch, and each spell I intend to create could use different items. A smaller question is: Is there a way to set a cooldown for a spell through script? (Some of the spells I would create would benefit from having a CD, so they could be more powerful). I'm hoping at least "some" of this is possible. Anyone with answers would be greatly appreciated. Link to comment Share on other sites More sharing options...
DarkWarrior45 Posted August 2, 2008 Share Posted August 2, 2008 Im currently in the thralls of creating a custom class and quest string for it, but my main focus is the way this class will cast spells. What I'm hoping to find out is: Is there a way to script a compenent neccessity (such as an item must be in the inventory for it to cast at all) which after the spell is cast removes the item from you're inventory, and (this is where it would get VERY tricky imo) then after a set amount of time replace the item in you're inventory. As in say for example 5 seconds after the spell is casts it adds the item back to you're inventory. The script would have to allow for spells to be self/target/touch, and each spell I intend to create could use different items. A smaller question is: Is there a way to set a cooldown for a spell through script? (Some of the spells I would create would benefit from having a CD, so they could be more powerful). I'm hoping at least "some" of this is possible. Anyone with answers would be greatly appreciated. Most of that is a piece of cake. Would be interesting for a spell to consume something like welkynd stones or soul gems as ammo. check here: http://cs.elderscrolls.com/constwiki/index..._My_First_Spell And here: http://cs.elderscrolls.com/constwiki/index...egory:Functions Link to comment Share on other sites More sharing options...
Vagrant0 Posted August 2, 2008 Share Posted August 2, 2008 The first one isn't really possible. You can't run any scripting before the spell is cast to prevent that spell from being used. At most, you could either make it so that the effects don't happen unless a component is present, or would need a non-spell script to add/remove the spell from the player based on the presence of any component. The first case requiring all the spell effects to be either script based, or something which can be achieved with an ability. A cooldown timer is however fairly easy, as long as you don't mind the player having the spell removed, rather than just being unavailable. You would just need a script on the spell which would work with a quest script through use of variables. When the spell is cast, the script changes a variable in a quest script which causes the spell to be removed, and a timer started. When the timer runs out, the spell is added back to the player. But this probably isn't something that someone new to scripting should try as it can be a bit complicated, especially if you want this to be done with multiple spells. Link to comment Share on other sites More sharing options...
LoginToDownload Posted August 2, 2008 Share Posted August 2, 2008 The first one isn't really possible. You can't run any scripting before the spell is cast to prevent that spell from being used. At most, you could either make it so that the effects don't happen unless a component is present, or would need a non-spell script to add/remove the spell from the player based on the presence of any component. The first case requiring all the spell effects to be either script based, or something which can be achieved with an ability.If you allowed yourself OBSE and a script that runs every frame or two, you could check if the player was using a Cast animation, check what their selected spell is and if they have the necessary component if so and, if applicable, play a different animation to interrupt the spell. I find BlockHit works well for those purposes. Link to comment Share on other sites More sharing options...
DarkWarrior45 Posted August 2, 2008 Share Posted August 2, 2008 The first one isn't really possible. You can't run any scripting before the spell is cast to prevent that spell from being used. At most, you could either make it so that the effects don't happen unless a component is present, or would need a non-spell script to add/remove the spell from the player based on the presence of any component. The first case requiring all the spell effects to be either script based, or something which can be achieved with an ability. A cooldown timer is however fairly easy, as long as you don't mind the player having the spell removed, rather than just being unavailable. You would just need a script on the spell which would work with a quest script through use of variables. When the spell is cast, the script changes a variable in a quest script which causes the spell to be removed, and a timer started. When the timer runs out, the spell is added back to the player. But this probably isn't something that someone new to scripting should try as it can be a bit complicated, especially if you want this to be done with multiple spells. I'm not seeing what your seeing. Everything I saw is possible using the three spell blocks and a quest script, without OBSE. Begin ScriptEffectStart ;check Cooldown timer (can be easily done in a quest script ;If cooldown timer has expired, then cast the spell, and remove the item from the player's inventory ;Else, display a message saying the player must wait for the spell to cool down. End Begin ScriptEffectFinish ;Replace the item into the player's inventory ;Start the cooldown timer in a Quest script end So yes, everything he wants is possible. You're not running any scripting before the spell is cast, but rather using a condition to check variables. Link to comment Share on other sites More sharing options...
LoginToDownload Posted August 2, 2008 Share Posted August 2, 2008 But then the spell is still cast, it just doesn't work. And you could only prevent the Script/Duration effects from doing anything. Link to comment Share on other sites More sharing options...
DarkWarrior45 Posted August 2, 2008 Share Posted August 2, 2008 But then the spell is still cast, it just doesn't work. And you could only prevent the Script/Duration effects from doing anything. Hhhmm... you do have a point there. Link to comment Share on other sites More sharing options...
kire12 Posted August 3, 2008 Author Share Posted August 3, 2008 Thank you all very much for the responses. I had figured that the first would be near impossible if not impossible.I'll go ahead and give up the ghost I suppose. I've been tinkering with the idea of creating the Deathknight class from WoW. I found the rune system to be very innovative, and was hoping to bring it into Oblivion. It would work as such:There would be a questline, that every few levels (TBD) you would use a spell to speak to the lich king. At that point he would give you new abilities.-These abilities would use the "blood", "frost", and "unholy" runes placed in your inventory at the beginning of the quest.--The runes would be consumed when the spells where used giving 10rune power (aka Magicka).--After a time the runes would be added back to you're inventory.-The spell system would have very specific rules. You're magicka is stunted and degenerates at 1/sec. --each of the magick schools would have -100values in the "Deathknight ability" to ensure you could not use them well. (exception is alchemy)--This would simulate the way runic power worked. As such, there would be spells that would use magicka still in some cases.-The pressences are already made with as much in common with their WoW counterparts as possible.-Many of the spell effects are already created, I'm just missing how to implement the system. My first suspision this would not work was when I realized the "cast" command does not work when using target/touch spells in scripts. My first idea was to use an If function to gather wether the rune was in inventory, and if so to cast the spell from within the script. If not the script would simply cast a spell such as +1magicka regain, (which with its degeneration, was almost completley useless) from within the script. I'll continue to work on this system, if anyone has any suggestions or if this gets big enough I'll post it in the suggestions/requests forums to see if anyone would like to take up the project or help directly. (btw I'm not completely new to scripting, but I do have trouble with harder quest scripts. My C programming courses have helped immensley, and I do use OBSE). Again thank you for the responses :thanks: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.