[crossfire] Spellcasting Swords & Python Troubles

Alex Schultz alex_sch at telus.net
Thu May 19 19:30:28 CDT 2005


Nicolas Weeger wrote:

>
     
      Nice idea to have spells :)
     
     >
     
      Imagine a sword casting a fireball, something like that :)
     
     
Yeah. Thanks :-)

>
     
     
     >
     
      After checking, the issue is that your rod doesn't have the "map" 
     
     >
     
      field correctly set. So when cast_spell calls get_map_flags 
     
     >
     
      (spell_util.c:1041), op being said rod, its map is NULL, which is a 
     
     >
     
      Bad Thing (tm).
     
     >
     
      The solution seems to do:
     
     >
     
           CFPython.CastAbility(activator, spellrod, spellname, direction, "")
     
     >
     
     
     >
     
      ie swap activator & spellrod.
     
     >
     
      That seems to work, as far as i can tell 
     
     
Thanks! It looks like I was silly and got the two mixed up there. That 
part is fixed now.

>
     
      (even though i wonder why i get a lightning when the spell is chaos 
     
     >
     
      spray...)
     
     
Due to the first issue I mentioned in my first e-mail, I hardcoded it to 
"spell_sm_lightning" for testing.  I'm going to add the needed 
functionality (getting the archetype name from an object) to the python 
plugin later tonight.

I just encountered another problem. For the direction to cast the spell, 
I'm using "GetDirection(activator)" which does properly get the 
direction that the player is going if the player is running, but it 
returns 0 (i.e. casting a cone spell around you or bolt under you) when 
the player is not running. Any ideas?

       Thanks,
             Alex Schultz (aka Rednaxela)

    
    


More information about the crossfire mailing list