Jump to content

Photo

Harp of ages


  • Please log in to reply
23 replies to this topic

#1 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 01 December 2008 - 08:29 PM

Well im trying to script a harp of ages that requires to be a global script. Im thinking that it will require 3 flags: 1 for the portal , 1 to put on the entire floor when you obtain the tune of currents, and one to put of both the past and present when you have the tune of time. How do i set this up? Need ideas please.

#2 lucas92

lucas92

    Defender

  • Members

Posted 01 December 2008 - 08:44 PM

Maybe try to do a cursor that select one action to do?

Edited by lucas92, 01 December 2008 - 08:44 PM.


#3 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 01 December 2008 - 08:47 PM

QUOTE(drzchulo973 @ Dec 1 2008, 08:29 PM) View Post

Well im trying to script a harp of ages that requires to be a global script. Im thinking that it will require 3 flags: 1 for the portal , 1 to put on the entire floor when you obtain the tune of currents, and one to put of both the past and present when you have the tune of time. How do i set this up? Need ideas please.

A while back, I tried to make my own Harp of Ages. I really didn't get that far at all. The warping is INCREDIBLY hard when it comes to Tune of Currents/Ages, ESPECIALLY if your quest has a lot of events that force you onto a new map...

Here, let me give you some of my old code to start you off:

CODE
// Harp of Ages: Yes, it's true! If you have certain items, this Harp will do different things!
// Changable Variables:
// ID1- ID of the item you wish to be the Tune of Echoes, the first Harp tune. Use std.zh for the IDs.
// ID2- ID of the item you wish to be the Tune of Currents, the second Harp tune. See above.
// ID3- ID of the item you wish to be the Tune of Ages, the final Harp tune. Also see the first.
// DrmntTmeHle- Combo used by the Dormant/Sleeping Time Hole (Before using Tune of Echoes).
// OpnTmeHle- Combo used by the Open/Awakened Time Hole (After using Tune of Echoes).lp

import "std.zh"
item script HarpofAges
{
    int CurMap = 0;
    int CurDMap = 0;
    int CurScrn = 0;
    int LastMap = 0;
    int LastDMap = 0;
    int LastScrn = 0;
    int WrpMap = 0;
    int WrpDMap = 0;
    int WrpScrn = 0;
    int WrpMap2 = 0;
    int WrpDMap2 = 0;
    int WrpScrn2 = 0;
    int ID1 = 32;
    int ID2 = 55;
    int ID3 = 0;
    int DrmntTmeHle = 0;
    int OpnTmeHle = 0;
    int Time = 1;
    int FFCLoad = 0;
    int FFCLocation = 0;

    void run()
    {
        CurMap = Game->GetCurMap();
        CurDMap = Game->GetCurDMap();
        CurScrn = Game->GetCurScreen();
        WrpMap = CurMap + 1;
        WrpDMap = CurDMap + 1;
        WrpScrn = CurScrn;
        WrpMap2 = CurMap - 1;
        WrpDMap2 = CurDMap - 1;
        WrpScrn2 = CurScrn;
        if (Link->Item[ID3])
        {
            if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
            {
                Time = 0;
                Link->PitWarp(WrpDMap2, WrpScrn2);
                Quit();
            }
            else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
            {
                Time = 1;
                Link->PitWarp(WrpDMap, WrpScrn);
                Quit();
            }
        }
        else if (Link->Item[ID2])
        {
            if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
            {
                Time = 0;
                Link->PitWarp(WrpDMap2, WrpScrn2);
                Quit();
            }
            else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
            {
                Time = 1;
            }
        }
        else if (Link->Item[ID1])
        {
            ffc FFCLoad = Screen->LoadFFC(32);
            FFCLocation = (FFCLoad->Y & 240)+(FFCLoad->X>>4);
            if (Screen->ComboD [FFCLocation] == DrmntTmeHle)
            {
                Screen->ComboD [FFCLocation] = OpnTmeHle;
                FFCLoad->Y = 0;
                FFCLoad->X = 0;
            }
        }
    }
}


Yeah, old stuff. However, you could make the code more efficient at checking for the right spot by using this snippet of code instead of the FFC checks:

CODE
for (int i = 0; i < 176; i++)
{
    if (Screen->ComboD[i] == InactiveTimeHole)
    {
        dostuff;
    }
}


That would basically check every single combo on the screen for a certain combo, and when it finds the combo, it does whatever you tell it to.

This was one of my earliest scripts, so it may not look pretty. I never figured out why the script would never warp me when I had the Tune of Currents, so I gave up on it. You may continue off my code if you wish, or just use it as an example for making your own script. Either way, good luck! It won't be easy.

#4 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 01 December 2008 - 09:17 PM

No lucas, first off i need to use alot of if and else if loops. Im trying to figure out a way that doesnt alot of checking. But the warping is just so darn COMPLICATED! i have a headache from it. Mathew dont worry ill just think of a way to shorten the const int variables. What if i edit the items as levels?

#5 lucas92

lucas92

    Defender

  • Members

Posted 01 December 2008 - 09:20 PM

Hum... Else if and if aren't loops...

Anyway, just tried to help. I don't even know how that harp of ages work. icon_razz.gif

#6 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 01 December 2008 - 09:46 PM

Oh yea they are used for checking. I was thinking of the while loop when i said that. Ill post up what i currently have written but its getting pretty complicated. Its using alot of if's and else if's and im trying setup the 3 diffrent sfxs and my head is getting twisted =p any other suggestions?

#7 Joe123

Joe123

    Retired

  • Members

Posted 02 December 2008 - 03:11 AM

You want the Harp of Ages and the Rod of Seasons in your quest?
You do realise that'll mean you need 7 duplicate screens for every screen you make, right?

I thought about doing this for about a nano-second, then I realised that 3 duplicate screens for every screen way by far enough already.

#8 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 02 December 2008 - 04:15 AM

Oh no. No, im just trying to make my first global script im not planning to put this in my quest. I have something set up, kind off. But it does'nt have the link animation tiles. Thats why i asked you for permission and see if i could slot that line in icon_shrug.gif

#9 Joe123

Joe123

    Retired

  • Members

Posted 02 December 2008 - 03:39 PM

Ohhh ok.
Fair enough.

#10 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 02 December 2008 - 04:49 PM

I just figured out i don't have patience writing in computer language. Now matter what i do to declare comboAt is undeclared. Also question. Is this valid?
CODE
if(Screen->ComboD[FFC] == CMB_SLEEPINGHOLE){ Screen->ComboD[FFC] == CMB_ACTIVEHOLE; }if(Screen->ComboD[FFC] == CMB_ACTIVEHOLE){this->WARP;


#11 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 02 December 2008 - 04:59 PM

QUOTE(drzchulo973 @ Dec 2 2008, 04:49 PM) View Post

I just figured out i don't have patience writing in computer language. Now matter what i do to declare comboAt is undeclared. Also question. Is this valid?
CODE
if(Screen->ComboD[FFC] == CMB_SLEEPINGHOLE){ Screen->ComboD[FFC] == CMB_ACTIVEHOLE; }if(Screen->ComboD[FFC] == CMB_ACTIVEHOLE){this->WARP;


Yes and no. You're wanting that to check if there's a combo at the location of the FFC "FFC", right? Well, this is where ComboAt comes in. It works as such:


ComboAt(location-x, location-y)

Simple. So, let's say we wanted to check for an FFC's location, and if a certain combo is there, then do stuff. You'd do this:

CODE
if(Screen->ComboD[ComboAt(FFC->X, FFC->Y)] == YourComboHere)
{
     dostuff;
}


That's basically it. As for your warp... You're DEFINITELY using that wrong. Sadly, I forgot how to work those... I know it's simple, though. To set them up, at least.

#12 lucas92

lucas92

    Defender

  • Members

Posted 02 December 2008 - 05:03 PM

Don't forget that one:

import "std.zh"

ComboAt is a function included in std.zh, so if you don't include that file, it won't work, unless you copy from std.zh that function. icon_razz.gif

#13 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 02 December 2008 - 09:47 PM

Ah! No wonder! I forgot to put in "import. Std.zh" in the file! *gets shot* i thought i was going crazy because no matter how much i was declaring ComboAt, it always seemed to compile undeclared. Thanks lucas for reminding me.
And if i check the activehole combo, and if true,can i make it an autowarp by using this code:
CODE

If(Screen->ComboD[ComboAt(this->X,this->Y)] ==CMB_ACTIVEHOLE){
     this->Data = CMB_AUTOWARP;

Can I do that or do I need to check the combo type by using:
CODE

if(Screen->ComboT[combotypenumber] == CMB_ACTIVEHOLE);
      this->Data = CMB_AUTOWARP;

Oh and the checking comes after the link animation is drawn and played.

Edited by drzchulo973, 03 December 2008 - 03:23 AM.


#14 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 03 December 2008 - 04:43 AM

QUOTE(Joe123 @ Dec 2 2008, 12:11 AM) View Post

You want the Harp of Ages and the Rod of Seasons in your quest?
You do realise that'll mean you need 7 duplicate screens for every screen you make, right?

I thought about doing this for about a nano-second, then I realised that 3 duplicate screens for every screen way by far enough already.



Why 7? What does the harp of ages do? ...I'm guessing it's something like time traveling. icon_sweat.gif


...But wouldn't that still only require 3?

#15 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 03 December 2008 - 05:50 AM

QUOTE(Gleeok @ Dec 3 2008, 04:43 AM) View Post

Why 7? What does the harp of ages do? ...I'm guessing it's something like time traveling. icon_sweat.gif
...But wouldn't that still only require 3?


Whoa that was tottally off topic from what I asked before you =p

But to answer your question, the harp of ages is used for time travel , as I am not adding the time traveling scene, because I'm not that too experienced to make something like that happen, even though I bet darkdragon would icon_smile.gif

And it doesn't require 3 duplicate maps and dmaps? Who said that? It only needs 2. That's why I'm using 2 flags.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users