Jump to content


Photo

SpellCastOnMe


  • Please log in to reply
9 replies to this topic

#1 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 03 November 2010 - 01:33 AM

Does it work properly? Because this code doesn't. :C
IF 
 SpellCastOnMe([ANYONE],WIZARD_GREASE) 
 Global("AerieHasWhatever","GLOBAL",0) 
THEN 
RESPONSE #100 
 CreateCreature("L-BLMAE",[-1.-1],0) 
 SetGlobal("AerieHasWhatever","GLOBAL",1) 
END

Edited by Almateria, 03 November 2010 - 01:34 AM.


#2 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 02:37 AM

Does it work properly? Because this code doesn't. :C

IF 
 SpellCastOnMe([ANYONE],WIZARD_GREASE) 
 Global("AerieHasWhatever","GLOBAL",0) 
THEN 
RESPONSE #100 
 CreateCreature("L-BLMAE",[-1.-1],0) 
 SetGlobal("AerieHasWhatever","GLOBAL",1) 
END

From my Trigger.ids:

SpellCastOnMeRES(S:Spell*,O:Caster*)

I think the order of the arguments is the opposite, and the RES is missing.
BTW, this trigger is not in IEDSP; how does this trigger work? Does it return true() if you are in the effect area of an area spell?
What happens if you resist to that spell?

Is there any way to specify who that "me" is?

I mean, if I want a script to be True if player2 is within range of a certain spell (eg, sunray), how can I do that?

Edited by Turambar, 03 November 2010 - 03:04 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#3 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 03 November 2010 - 03:19 AM

I think the order of the arguments is the opposite, and the RES is missing.
BTW, this trigger is not in IEDSP; how does this trigger work?

It is there, see? :x The RES version isn't, though.

0x00A1 SpellCastOnMe(O:Caster*,I:Spell*Spell)
Returns true only if the specified object cast the specified spell on the active CRE in the last scriptround.

The RES version isn't, though.

#4 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 03 November 2010 - 03:46 AM

SpellCastOnMe and SpellCastOnMeRES probably only work with single-target spells, or something like that. "Me" is the guy who the script is attached to (the active creature).

#5 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 03 November 2010 - 04:29 AM

But it doesn't work with magic missiles either. Or fireballs. Or anything.

#6 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 06:04 AM

But it doesn't work with magic missiles either. Or fireballs. Or anything.

Do you mean that you can compile it, but it just doesn't work?

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#7 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 03 November 2010 - 06:49 AM

Do you mean that you can compile it, but it just doesn't work?

Yup, this.

#8 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 08:07 AM

Do you mean that you can compile it, but it just doesn't work?

Yup, this.

I've had a similar problem, and I'll try this way:
- Append a new line "[number] prefix_[name]" to specific.ids (please don't use number 254, I'll use it; check the number you choose is not used yet; I'll have to check if there is a 'reservation list' for that ids)
- Change the spell adding an effect (use weidu function ADD_SPELL_EFFECT)using opcode 72, par1 = [the number you chose], par2 = 4 , duration=1 (I believe that would meen it is set for 1 script round only)

The trigger for the script would be:
Specifics("Aerie",[the string you added to specifics.ids])
and you should use a second variable to prevent the script from triggering more than once.

Edited by Turambar, 03 November 2010 - 08:44 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#9 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 04 November 2010 - 07:59 AM

Oh my. ._. How many strings can fit in specific.ids, then?

#10 Turambar

Turambar
  • Modder
  • 935 posts

Posted 04 November 2010 - 08:42 AM

Oh my. ._. How many strings can fit in specific.ids, then?

I believe 256 (numbered 0 to 255). 0 means no state; what I suggest is to use a FOR which looks for all numbers in the ids file and stops when one is still 'free'. I can attach the code I used, but I'll have to look for it

of course, if anyone found out how to make that script of yours working, it would be much better

edit: if you look at my thread in the same forum, Mike suggested to use opcode 309 set local: you could set a local variable on everyone, and then Aerie's script could contain:
IF 
 Global("[name such as AerieGrease]","Local",1) 
 Global("AerieHasWhatever","GLOBAL",0) 
THEN 
RESPONSE #100 
 CreateCreature("L-BLMAE",[-1.-1],0) 
 SetGlobal("AerieHasWhatever","GLOBAL",1) 
END
of course, the local variable would be set ANY time the spell is used, for anyone who's hit by that, but it would just stay there..

Edited by Turambar, 04 November 2010 - 09:25 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg