Author Topic: How do I make a spell that targets a combatant or a location?  (Read 1357 times)

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #30 on: February 14, 2017, 07:38:13 PM »
Quote from: Manikus
does not allow $SET_SPELL_SA(

For good reason.  It is not allowed.
You cannot change the definition of a spell at runtime.
The Special Abilities attached to a spell are part of its
definition.  You cannot change the Special Abilities of
a spell at runtime.  This is documented at:
http://dianneandpaul.net/UAF/Help/SASpecialAbilitiesScripts.html

Combatants change during gameplay; spells do not.
Spells are constant.

Perhaps if we knew what you are attempting?????
Are you attempting to change the spell's action depending
on the player's response to the OverrideSpellTarget hook?

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #31 on: February 15, 2017, 05:25:52 PM »
Quote from: Paul
For good reason.  It is not allowed.
You cannot change the definition of a spell at runtime.
The Special Abilities attached to a spell are part of its
definition.  You cannot change the Special Abilities of
a spell at runtime.  This is documented at:
http://dianneandpaul.net/UAF/Help/SASpecialAbilitiesScripts.html

Combatants change during gameplay; spells do not.
Spells are constant.

Perhaps if we knew what you are attempting?????
Are you attempting to change the spell's action depending
on the player's response to the OverrideSpellTarget hook?
I am trying to record whether the player has chosen "Map" or "Combatant" (or "Duck" or "Goose or whatever).

I do realize that I was trying to change the spell, but I thought there was temp version while it was being cast, but of course that makes no sense. I thought that adding something to it that wouldn't change how it funtioned would be a good way of keeping track of this choice.

I haven't tried using an ASL, because I didn't think I would have access to the info until the start of the next combat round (and I wanted it immediately).

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #32 on: February 15, 2017, 06:28:42 PM »
Quote
adding something to it that wouldn't change how it funtioned

But....!  Changing how it functioned is exactly what you are
attempting to do!  Is it not?

An ASL should work. If the information is going to be used
immediately, it should work fine.  Modifications to an ASL take
place immediately and can be accessed immediately.  For that
matter, you could put your information in a quest stage.

Why not put the information in an SA attached to the caster?
This might be better.

What I worry about is that:
1) Cast the spell and select a target
2) Put the information in an ASL
3) Another character casts the spell and selects a target
4) Put new information in the ASL
5) Use the information in the ASL   Oooops....wrong information!
6) Use the information in the ASL 

Perhaps this is impossible in your case.  If it were possible
in ANY case, it would be bad because other folks might copy
your example in cases where it would fail.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #33 on: February 15, 2017, 07:22:33 PM »
I totally gt how it is changing the spell, I was just explainging why I wanted to do that. :) I know that it would be bad, but I had been thinking about it wrong.

I had thought about using a combatant SA, but the context is the Spell, and the places the Hook is looked for is the spell.
If you give me the combatant, or combatant->attacker context, I will do this.

For the ASL, you make a good point. It could still work if I did a time check. But, now I am storing multiple data points in the ASL, not too difficult, but if we can do it easier by adding combatants as a context to the Hook, that would be better. :D

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #34 on: February 16, 2017, 08:52:23 AM »
Quote
but if we can do it easier by adding combatants as a context to the Hook

Adding additional context is very straight-forward and easy.  Exceot
for updating the documentation.  I'll add this later today.  After I
get two teeth pulled and my jawbone drilled for implants.   :(

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #35 on: February 16, 2017, 12:12:10 PM »
Quote
but if we can do it easier by adding combatants as a context to the Hook

Adding additional context is very straight-forward and easy.  Exceot
for updating the documentation.  I'll add this later today.  After I
get two teeth pulled and my jawbone drilled for implants.   :(

Thanks, Paul. You are far more hearty than I am. A visit to the dentist (or the eye doc) and I am done for the day.

I am discovering that I really don't know as much about spells as I thought that I did. I have used AURAs on multiple monsters, but not as a spell effect. There is a learning curve.

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #36 on: February 16, 2017, 01:03:52 PM »
Version 2.72 of the engine adds Attacker Context (The combatant
who cast the spell).

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #37 on: February 16, 2017, 01:27:04 PM »
Version 2.72 of the engine adds Attacker Context (The combatant
who cast the spell).

Thank you, Paul. :D
I am getting it now.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #38 on: February 22, 2017, 01:04:33 PM »
I am still getting GPDL errors when I use $AttackerContext() with ProcessSpellTargetOverride.

I would slso like to request that $TargetContext() for this Hook. Why? I am using the $Create_AURA() function and the context is passed on to the SA it called. Let me reword that, I think the restriction against certain contexts is passed on to the called SA. I need the option, else all AURAs are placed on the caster.

I would also like to request $AttackerContext() for OverrideSpellTargeting, so I can easily place the x and y coordinates in a sA for later use.

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #39 on: February 22, 2017, 03:38:42 PM »
Ooops.   I messed that up a bit.
I put in in OverrideSpellTargeting (where I thought it was
needed)  but not in
ProcessOverrideSpellTargeting and did the opposite
in the documentation.

I'll see to it this evening.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #40 on: February 22, 2017, 05:10:39 PM »
Ooops.   I messed that up a bit.
I put in in OverrideSpellTargeting (where I thought it was
needed)  but not in
ProcessOverrideSpellTargeting and did the opposite
in the documentation.

I'll see to it this evening.

Thank you, Paul.

I was getting an error for $AttackerContext() for both Hooks, and I would like to have the context for both Hooks.
« Last Edit: February 22, 2017, 05:17:43 PM by manikus »

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #41 on: February 22, 2017, 06:27:56 PM »
Quote
I was getting an error for $AttackerContext()

You should not have gotten any error for the one case.

Engine version 2.75 supplies Attacker and Target
context for both hooks.  If you got an error before and
you still get an error, I guess we will need a mini-mod.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #42 on: February 22, 2017, 06:30:47 PM »
Quote
I was getting an error for $AttackerContext()

You should not have gotten any error for the one case.

Engine version 2.75 supplies Attacker and Target
context for both hooks.  If you got an error before and
you still get an error, I guess we will need a mini-mod.

Thank you, Paul.
If I got an error before and still get one, the first thing I need to do is make sure my script is correct. :) If the problem persists, you will get a mini-mod.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: How do I make a spell that targets a combatant or a location?
« Reply #43 on: February 23, 2017, 01:22:51 PM »
The contexts work well. However, I am getting an error.
In the mini-mod I've attached, the first time the spell is cast, "Combatant" is chosen and that works exactly as it should. The second time it is cast, I chose "Map" and get an error and the spell does not work.

Online Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: How do I make a spell that targets a combatant or a location?
« Reply #44 on: February 24, 2017, 05:20:14 PM »
Attaching an aura to an x,y location was never implemented.

Engine version 2.76 attempts to implement this feature.
Available in 10 minutes.

 

anything