Jump to content

Photo

stdWeapons.zh

library beta

  • Please log in to reply
93 replies to this topic

#91 ZoriaRPG

ZoriaRPG

    ZC Wiki Editor

  • Members
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 08 January 2017 - 09:17 AM

Mid-slash? Unfortunately, you can`t control melee weapon stuff midway trough sequence because Zscript doesn`t allow code injection into function.


Hmm?

You could adjust the position within the ffc. He apparently wants to read the present tile, and flip, then move the coordinates of the desired draw and hit offsets. The controlling ffc can do all of that.

If the swords no longer use ffcs, then whatever function is setting their tile could be modified to move the draw and hitoffsets, globally.

Edited by ZoriaRPG, 08 January 2017 - 09:19 AM.


#92 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 08 January 2017 - 08:39 PM

The problem is the fact that melee weapon function won`t return to controlling script until finishing slash/stab sequence.



#93 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 08 January 2017 - 09:21 PM

whats the best way to do it without the melee functions?



#94 ZoriaRPG

ZoriaRPG

    ZC Wiki Editor

  • Members
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 26 January 2017 - 10:17 PM

Something I would ask, if you decide to make a version of this for 2.54, is to modify the drawing system, to use sprites provided by the item editor. The sword stab, slash, and beam sprites, for example, can be set, and read, as any normal sword would.

 

You can also do this now:

 

item script WeaponLauncher{
    void run (int d0, int d1, int d2, int d3, int d4, int d5, int d6, int d7){
        int q;
        int ffcscript = this->Attributes[9]; //From the item editor.
        int itm = this->ID;
        int args[8] = {d0,d1,d2,d3,d4,d5,d6,d7}; //Now you have all eight, plus up to nine more Attributes[].
        ffc launch = RunFFCScriptOrQuit(ffcscript, args);
        /* You could also use the editor flags 1-5 as a flagset and forward them.
        int flags;
        if ( this->Flags[0] ) flags |= 00001b; if ( this->Flags[1] ) flags |= 00010b; if ( this->Flags[2] ) flags |= 00100b;
        if ( this->Flags[3] ) flags |= 01000b; if ( this->Flags[4] ) flags |= 10000b; //Silly way to store five individual bits.
        launch->Misc[17] = flags; //FFC can now read the item flags as flagset&bit.
        */
 
        // or just use the forwarded item ID, which is simpler.
        launch->Misc[16] = this->ID; //Store the ID of the item that launched this.
        //then do itemdata id = Game->LoadItemData(this->Misc[16]) from the ffc, and you can read any property of
        //the item that spawned it. :)
       
    }
}

 

You can see that your options have opened up quite a bit.


  • Alucard648 likes this



Also tagged with one or more of these keywords: library, beta

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users