Jump to content

Photo

Using up counters on Use of Item


  • Please log in to reply
29 replies to this topic

#1 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 02 April 2014 - 02:59 PM

I want it so that each time you jump a certain Roc's feather uses three bombs. How can this be done?

Thank you!!!!!!! : D

-Strike

Edited by strike, 02 April 2014 - 02:59 PM.


#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 02 April 2014 - 03:01 PM

You can only do it through scripting. Do you want the script? :)

#3 coolgamer012345

coolgamer012345

    馃敻

  • Members
  • Location:Indiana, USA

Posted 02 April 2014 - 03:03 PM

I want it so that each time you jump a certain Roc's feather uses three bombs. How can this be done?

Thank you!!!!!!! : D

-Strike

Well in the item editor go to the Pickup tab and put in the "Counter Reference" drop down tab Bombs, Then below it put in -3, This (should) then use 3 bombs when you use the rocs feather. 


  • strike likes this

#4 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 02 April 2014 - 03:08 PM

Are you sure that works? I can't use ZQuest right now.

-Strike

#5 coolgamer012345

coolgamer012345

    馃敻

  • Members
  • Location:Indiana, USA

Posted 02 April 2014 - 03:13 PM

Are you sure that works? I can't use ZQuest right now.

-Strike

I am sure it would work, But I am not sure if the Rocs feather would stop working after all the bombs ran out.



#6 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 02 April 2014 - 03:16 PM

Nope that wouldn't work. The pickup tab is used for when Link "picks up" the item. If you put -3 on there, this means you would loose 3 bombs when picking up the roc's feather. Makes sense, actually :D

Here's a script. Sorry, it's not very customizable, but I hope it'll work out for you.

const int RocsFeatherItemID = 0; //item ID of Roc's Feather

item script UseUp3Bombs{
    void run(){
        Game->Counter[CR_BOMBS] -= 3;
    }
}

global script active{
    void run(){
        while(true){
            if ( GetEquipmentB() == RocsFeatherItemID && Game->Counter[CR_BOMBS] < 3 ) {
                Link->PressB = false;
                Link->InputB = false;
            }
            if ( GetEquipmentA() == RocsFeatherItemID && Game->Counter[CR_BOMBS] < 3 ) {
                Link->PressA = false;
                Link->InputA = false;
            }
            Waitframe();
        }
    }
}
This is how I'd script it, anyways. I'm sure there's a different way to script it, though.

#7 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 02 April 2014 - 03:54 PM

Thanks Avataro! :D

If I want it to be four bombs I should just replace all the threes with fours right? Also since it is global will it slow down the quest any?

Thanks so much!

-Strike

#8 David

David

    Fallen leaves... adorn my night.

  • Administrators
  • Real Name:David
  • Pronouns:He / Him

Posted 02 April 2014 - 04:04 PM

Yeah, that should work. Also, it shouldn't lag the game at all because this is a very small script. :)


Edited by DaviAwesome, 02 April 2014 - 04:04 PM.


#9 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 April 2014 - 04:20 PM

I was wondering why you used the global script, instead of just using an if statement on the item active script, and then I realised that your method is actually a bit more elegant than what I would have done. That's a rather useful way to handle counter-based items that aren't fully-scripted.

 

Many of my items are fully scripted, so I would have tied the CR check to the item activation script, rather than the global, starting with something like this:

 
if Game->Counter[CR_BOMBS] < 3 ) {
    Game->Counter[CR_BOMBS] - 1;
    //Do item functions
    //produce sfx.
}
else {
    //produce error sfx
    return;
}

With an item that already has a function, this wouldn't work well, because it wouldn't stop the item from using its in-built abilities, so linking it to the global is good, although it does mean you need to do a lot of bookkeeping if you want to change anything, because the global isn't using a variable.

 

What I'd suggest here, is to create a global int for rocDCounter, and set the value of this on the item pickup script, and use this assign in the global functions for the amount to decrease the counter; or for the counter to use.

 

The assign makes it a lot more flexible, and would allow you to control the value of counter items used with upgrades to the item, if you would ever want to do that.

 

I do have to ask: Why bombs for Roc's Feather?

 

That seems quite a bit, illogical. Are you making a CastChaos-esque quest, so we should expect torches to be activated by arrows, and bush triggers to require the boomerang? :P


Edited by ZoriaRPG, 02 April 2014 - 04:28 PM.


#10 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 02 April 2014 - 04:40 PM

Thank you so much for the script Avataro!

There is an optional item called the bomb boots which make you jump up an entire screen. They make the bomb sound when used and use up four bombs.

-Strike

#11 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 April 2014 - 07:56 PM

With all the explosives in the land of Hyrule, I am less shocked that evil forces go after the Triforce to dominate the world. They could just as easily stock up on all the easily acquired detonable items, and demolish entire kingdoms. Now, we know why bombs are such valid currency and are available in such abundance: You need them to fly.

 

Just try that in real life: Explode some C4 under yourself, and see how far you can go! Huzzah!

 

When you say 'jump an entire screen', ignoring how little sense 'bomb boots' makes, what in the world do you mean? Does it move link up a floor in DMAPs? Does it move link to the same X/Y coordinates one screen away? If so, is this based on the direction he is facing? What happens if the combo at those coordinates is not walkable? Does it work everywhere? What if there is no adjacent screen?

 

It's so absurd, as to be marvellous, but I don't understand how you intend that to function.

 

By the way, if you eat a bomb, and it explodes in you, scattering your remains, does that count as you moving, or does is it more like 'In Soviet Russia, bomb moves you!' ?



#12 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 03 April 2014 - 02:51 PM

The game is side view. It sends you up one screen. It's just a really high jump.

I find it pretty amusing that you get such a kick out of this. :lol:

-Strike

#13 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 04 April 2014 - 05:03 PM

Save me! I just remembered I'm a total n00b at scripts! Even uploading them!

 

How do you add a global script into my game. Sorry, I basically never use scripts. Sorry!

 

Anyone able to help?

 

-Strike



#14 coolgamer012345

coolgamer012345

    馃敻

  • Members
  • Location:Indiana, USA

Posted 04 April 2014 - 05:22 PM

Save me! I just remembered I'm a total n00b at scripts! Even uploading them!

 

How do you add a global script into my game. Sorry, I basically never use scripts. Sorry!

 

Anyone able to help?

 

-Strike

Just like a normal FFC script, But into the global tab in the script assigner thing (Where you put in imported scripts).



#15 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Ol贸rin

Posted 04 April 2014 - 05:43 PM

Do you need import "std.zh"; in the front because when I put that it won't compile. If I take it away it says BOMB_CR is undefined.

 

What am I doing wrong?

 

Thanks for the help!

 

-Strike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users