Jump to content

Photo

Shield Spell


  • Please log in to reply
33 replies to this topic

#16 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 04:04 PM

realized that right after i posted, edited above.

Edit: Still a great idea, if you're okay with Link's sprite palette remaining unchanged

Ture...but on the other hand, it would be nice to see the pallet change....



#17 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 April 2015 - 04:10 PM

Either way is definitely doable. The peril ring is easier, but using just "ring" class items is definitely possible.

#18 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 04:17 PM

Since the Peril Ring Spell is temporary, perhaps I can change Link's pallet while the spell lasts...then when the spell is done, Link will return to his origial pallet....



#19 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 April 2015 - 04:19 PM

The only way to change Link's palette is to give him a Ring item. If you want a shield spell that upgrades you to the next tier Ring temporarily (and doesn't freak out if you obtain the same ring permanently while it's active), I can make a version sorta-similar to jsm's for you.


  • Binx likes this

#20 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 04:47 PM

The only way to change Link's palette is to give him a Ring item. If you want a shield spell that upgrades you to the next tier Ring temporarily (and doesn't freak out if you obtain the same ring permanently while it's active), I can make a version sorta-similar to jsm's for you.

Actually, lets keep it simple. The Blue and Red Ring are item you can get in my quest and, of course, they will change Link's pallet permanently. Let's make the Shield Spell activate the Peril Ring temporarily. I want only the Rings to change link's pallet and not the Shield Spell. Doesn't matter to me if the Shield Spell does not change Link's pallet.

 

PS. Also, thank you for helping me with this. Means a lot!


Edited by AtrusW0nder, 30 April 2015 - 04:50 PM.


#21 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 April 2015 - 04:52 PM

So... does the script you have do what you want in this case?



#22 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 05:11 PM

So... does the script you have do what you want in this case?

Yes, I basically just want a Spell that activates the Peril Ring either temporarily or permanently until you leave the screen...I prefer the second option. Can you make this script for me? I don't know anything about making a script...


Edited by AtrusW0nder, 30 April 2015 - 05:15 PM.


#23 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 April 2015 - 05:32 PM

I think jsm's script should do that already. I just tweaked it to a) fix a couple typos, and b) remove the shield when you change DMaps (in case you go to the same screen in the DMap), and c) add some SFX. Hope you don't mind, jsm?

//This variables go outside your global
int shieldcastscreen;
int shieldcastDMap;
int shielditem;
int shieldtimer;

global script active
{
void run()
{
  while(true)
  {
   //These lines go somewhere in your active global script
   if(Game->GetCurDMapScreen() != shieldcastscreen
   || Game->GetCurDMap() != shieldcastDMap)
   {
    Link->Item[shielditem] = false;
    shieldtimer = 0;
   }

   if(shieldtimer == 0)
    Link->Item[shielditem] = false;
   if(shieldtimer > 0)
    shieldtimer --;
  
   Waitframe();
  }
}
}

//This item script should be attached to the active slot of an item that doesn't do anything else
//D0: The item number of the actual ring item with your defense
//D1: MP cost for using the spell
//D2: Duration in frames, or -1 for no timer (60 frames = 1 second)
//D3: SFX to play when spell activates
//D4: SFX to play if out of magic or spell already active
item script shieldring
{
void run(int activeitemnum, int mpcost, int duration, int sfx, int errorsfx)
{
  int cost = mpcost*0.5*Game->Generic[GEN_MAGICDRAINRATE];
  if(Link->MP >= cost && Link->Item[activeitemnum] == false)
  {
   Link->Item[activeitemnum] = true;
   shieldcastscreen = Game->GetCurDMapScreen();
   shieldcastDMap = Game->GetCurDMap();
   shielditem = activeitemnum;
   Link->MP -= cost;
   shieldtimer = duration;
  
   Game->PlaySound(sfx);
  }
  else
   Game->PlaySound(errorsfxsfx);
}
}

Edited by MoscowModder, 30 April 2015 - 05:34 PM.
Added SFX


#24 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 05:34 PM

 

I think jsm's script should do that already. I just tweaked it to a) fix a couple typos, and b) remove the shield when you change DMaps (in case you go to the same screen in the DMap). Hope you don't mind, jsm?

//This variables go outside your global
int shieldcastscreen;
int shieldcastDMap;
int shielditem;
int shieldtimer;
global script active
{
void run()
{
  while(true)
  {
   //These lines go somewhere in your active global script
   if(Game->GetCurDMapScreen() != shieldcastscreen
   || Game->GetCurDMap() != shieldcastDMap)
   {
    Link->Item[shielditem] = false;
    shieldtimer = 0;
   }
   if(shieldtimer == 0)
    Link->Item[shielditem] = false;
   if(shieldtimer > 0)
    shieldtimer --;
  
   Waitframe();
  }
}
}
//This item script should be attached to the active slot of an item that doesn't do anything else
//D0: The item number of the actual ring item with your defense
//D1: MP cost for using the spell
//D2: Duration in frames, or -1 for no timer (60 frames = 1 second)
item script shieldring
{
void run(int activeitemnum, int mpcost, int duration)
{
  int cost = mpcost*0.5*Game->Generic[GEN_MAGICDRAINRATE];
  if(Link->MP >= cost && Link->Item[activeitemnum] == false)
  {
   Link->Item[activeitemnum] = true;
   shieldcastscreen = Game->GetCurDMapScreen();
   shieldcastDMap = Game->GetCurDMap();
   shielditem = activeitemnum;
   Link->MP -= cost;
   shieldtimer = duration;
  }
}
}

Thanks a lot man! Yea, I'm cool with this script. So what exactly does it cast? Peril Ring or the normal rings?



#25 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 April 2015 - 05:36 PM

Could be either. The script doesn't care. Also note my edit that adds SFX.



#26 AtrusW0nder

AtrusW0nder

    Creator

  • Members

Posted 30 April 2015 - 05:45 PM

Could be either. The script doesn't care. Also note my edit that adds SFX.

Next question: Who can help me install it? Global and active global are a different language to me...



#27 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 April 2015 - 05:55 PM

If you don't already have a global script: Use it as is; assign it to the "Active" slot when compiling.

 

If you already have a global script: Copy everything inside the while(true) block (between the "{ }") except the Waitframe() statement (you'll already have one of those). Paste it somewhere in your existing global script, like above your existing Waitframe(). Put the global variables at the top of your file with your other constants and globals; put the FFC script below the global script with any others you have. The order of your variables and scripts isn't necessary but helps keep your script organized.



#28 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 30 April 2015 - 07:02 PM

Mod away. Mine was really just the bare bones of the idea.



#29 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 May 2015 - 05:37 AM

Are the present value of heart requirement, and the damage divisor for the peril ring stored in Game->Item[I_PERILRING]->Misc[] ?

 

If so, does anyone know which indices?  It would be a nifty way to allow variable damage reduction when checking for collision based on various factors (think: 'Ys').


Edited by ZoriaRPG, 11 May 2015 - 05:38 AM.


#30 justin

justin

    Adept

  • Members

Posted 11 May 2015 - 06:47 AM

All the pointer->Misc[] values are used for scripts only. They do not correspond with anything in the editor.

Furthermore the item pointer class is for placing items on screen not for changing the function of an item, that is the itemdata class. itemdata->Power is fairly useful, but it would certainly be nice to access the other itemdata values from the editor.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users