Jump to content

Photo

Trick to changing seasons in zquest


  • Please log in to reply
48 replies to this topic

#31 Captain Magenta

Captain Magenta

    Senior

  • Members
  • Real Name:Brian
  • Location:Sin City, Nevada

Posted 22 November 2008 - 07:57 PM

Unfortunately man, Joe's right. If you want to have something unique to your quest, then you should take the time and effort to do it yourself, which will ultimately be much more rewarding for you in the end anyway. I understand if you probably are not completely familiar with scripting, but just as you can ask someone to craft something for you, you could just as easily have asked Joe to PM you all the basic information that you would need to build the script yourself, or read up on scripting so that you can figure it out for yourself. If you truly want your quests to be remembered, it's not only about how many gimmicks or tricks your quest employs, or it's graphics though of course those can help. If you can craft a really compelling storyline that will keep the player wanting to continue to see what happens next, and balance that with entertaining gameplay including finding new and unique ways to utilize existing weapons and equipment, that will provide something worth remembering for potential players. You could have all the tricks in the world out of your magician's grabbag and graphics that would make even Linkus' jaw hit the floor but if your quest is for instance just another rehash of the first quest with nothing new to bring to the table, it's novelty will quickly wear off and players will see it for what it really is, all show and no substance.

Think about The Hero Of Dreams; though the game by professional standards was not quite completely polished (Nonetheless it was an outstanding effort for Shoelace's first quest build!) and didn't feature anything truly groundbreaking other than that things like the trading sequence and minigames had not been done in ZC before, the quest's storyline and unique gameplay situations (One that really comes to mind was the area in the Death Mountain Inferno dungeon where Link is temporarily stripped of his blade and items in order to progress through the area to acquire the hidden treasure within the dungeon) made it one of the two best quests to be released so far, with my other nominee being Lost Isle without question. Lost Isle too didn't bring a whole lot of new mechanics to the table either and even limited the number of items you could acquire in comparison to other quests (Like no hammer or hookshot), but it more than made up for it by having a wild story behind Link's travels on the island, and found new ways to use existing items, such as the Whistle, at least in ZC anyway. For that matter, Shoelace implemented a pretty effective seasonal system in Hero Of Dreams without scripting, and depending on whether the size of your quest would make his method ineffective or not, you could also ask him how he accomplished Season Isle. In short, if you want to have a feature unique to your quest, learn how to accomplish your idea if it's possible and do it yourself, then keep it under wraps until at least the demo is released so that it will truly surprise players who may have never seen it before when they play your latest creation.....

#32 Christian

Christian

    Summoner

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

Posted 22 November 2008 - 08:01 PM

Oh, my intention was never to be greedy about it. Im not greedy myself either. I will not be passwording my quest so the people can use the scripts i have. But hey, joe's the main scripter here. So what joe saids goes =)

Edited by drzchulo973, 23 November 2008 - 03:22 AM.


#33 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2008 - 05:31 AM

Right, well I think I'm pretty much finished.

Here is an example quest, to show you how it's set up, and how it currently works.
Have a play through it, and let me know if you think that's how it should be.
The trees in square boxes are the season spirits, the little chequered tiles are the season change flags, and you start with the 'Summer' and 'Winter' spirits already.
See if you can get the sword ^_^

CODE
import "std.zh"

//Constants
const int F_SEASONCHANGE    = 98;        //Flag you can change the season on
const int I_SPRING            = 124;        //Spring Season Spirit Item
const int I_SUMMER            = 125;        //Summer Season Spirit Item
const int I_AUTUMN            = 126;        //Autumn Season Spirit Item. Not to be replaced with 'fall'.
const int I_WINTER            = 127;        //Winter Season Spirit Item
const int DM_SPRING            = 0;        //Spring DMap
const int DM_SUMMER            = 1;        //Summer DMap
const int DM_AUTUMN            = 2;        //Autumn DMap
const int DM_WINTER            = 3;        //Winter DMap
const int SFX_OCARINA        = 33;        //Ocarina song to play
const int SFX_WARPING        = 39;        //SFX to play when Link warps
const int T_LINKOCARINA        = 26413;    //First tile of Link Playing Ocarina animation
const int OcarinaSongLength    = 170;        //Length in frames of Ocarina sound effect
const int OcarinaNumFrames    = 2;        //Number of frames of Link Playing Ocarina animation
const int OcarinaASpeed        = 20;        //Speed of Link Playing Ocarina animation
const int WarpTime            = 40;        //Time to wait while the screen goes wavy when Link warps

//Global Variables
bool PlayingOcarina;

bool ComboFI(int x,int y,int combotype){
if(Screen->ComboF[ComboAt(x,y)] == combotype
|| Screen->ComboI[ComboAt(x,y)] == combotype) return true;
}

global script Slot_2{
    void run(){
        while(true){
            //Call the Season Ocarina functions
            if(PlayingOcarina) SeasonOcarina();
        Waitframe();
        }
    }
    void SeasonOcarina(){
    int i;
    int x = Link->X;
    int y = Link->Y;
    int hp = Link->HP;
    int DMap = Game->GetCurDMap();
    int Warp = -1;
        if(DMap == DM_SPRING){
            if(Link->Item[I_SUMMER]) Warp = DM_SUMMER;
            else if(Link->Item[I_AUTUMN]) Warp = DM_AUTUMN;
            else if(Link->Item[I_WINTER]) Warp = DM_WINTER;
        }else if(DMap == DM_SUMMER){
            if(Link->Item[I_AUTUMN]) Warp = DM_AUTUMN;
            else if(Link->Item[I_WINTER]) Warp = DM_WINTER;
            else if(Link->Item[I_SPRING]) Warp = DM_SPRING;
        }else if(DMap == DM_AUTUMN){
            if(Link->Item[I_WINTER]) Warp = DM_WINTER;
            else if(Link->Item[I_SPRING]) Warp = DM_SPRING;
            else if(Link->Item[I_SUMMER]) Warp = DM_SUMMER;
        }else if(DMap == DM_WINTER){
            if(Link->Item[I_SPRING]) Warp = DM_SPRING;
            else if(Link->Item[I_SUMMER]) Warp = DM_SUMMER;
            else if(Link->Item[I_AUTUMN]) Warp = DM_AUTUMN;
        }
        Game->PlaySound(SFX_OCARINA);
        Link->Dir = 1;
        for(i=0;i<OcarinaSongLength;i++){
            Screen->DrawTile(3,x,y,T_LINKOCARINA+(Floor(i/OcarinaASpeed)%OcarinaNumFrames),1,1,6,1,0,0,0,0,true,128);
            Link->Action = LA_DROWNING;
            Waitdraw();
            Link->X = x;
            Link->Y = y;
            Link->HP = hp;
        Waitframe();
        }
        Link->Action = LA_FROZEN;
        if(Warp != -1 && ComboFI(Link->X+8,Link->Y+8,F_SEASONCHANGE)){
            Game->PlaySound(SFX_WARPING);
            Screen->Wavy = WarpTime;
            Waitframes(WarpTime/2);
            Link->PitWarp(Warp,Game->GetCurDMapScreen());
            Waitframes(WarpTime/2);
        }
        Link->Action = 0;
        PlayingOcarina = false;
    }
}

global script Slot_3{
    void run(){
        PlayingOcarina = false;
    }
}
    

item script SeasonChanger{
    void run(){
        if(Link->Z == 0) PlayingOcarina = true;
    }
}


If it's set up how you like in the example quest, I can help you combine it with the scripts you already have.
If you need that.

#34 lucas92

lucas92

    Defender

  • Members

Posted 23 November 2008 - 10:09 AM

The download doesn't work for me... icon_frown.gif

I don't get that part of the script:

CODE
else Warp = -1;


? Warp=-1? That would do nothing, right? Simple script. I like it. icon_smile.gif

#35 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2008 - 10:38 AM

Oh would'yu look at that, it wouldn't work for me either ¬_¬
I should really check that before I post links shouldn't I.

I was going to upload another one, but then I realised I'd deleted the file =P
I have a feeling it'll work again later though, mediafire said something about servers not currently being available, so maybe if you try again tomorrow?


Anyway.
Setting 'Warp' to '-1' doesn't actually do anything with the 'Link->PitWarp()' command, but if you look at this line:
CODE
        if(Warp != -1 && ComboFI(Link->X+8,Link->Y+8,F_SEASONCHANGE)){

It checks whether Warp is -1 before warping Link.
'-1' is like a sort of 'null' situation.
If Link happens to be on a DMap that he isn't supposed to be able to warp from, or if he doesn't have the right season spirit, warp will be set to -1, so he won't be warped anywhere.

#36 lucas92

lucas92

    Defender

  • Members

Posted 23 November 2008 - 11:07 AM

Ok, I've got it. icon_smile.gif

#37 Christian

Christian

    Summoner

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

Posted 23 November 2008 - 02:51 PM

awesome joe! thanks so much for your help icon_smile.gif ok , the file is "blocked" it saids enter a password or something to unlock it icon_shrug.gif do you mind choosing another file host? and yeah I have A LOT of global scripts active in the quest though. for example: the fairy,climbing,ladders,gameboy shield,rolling(which im thinking about deleting actually its annoying) that's pretty much it. maybe i'll add in your roc's cape later on though.

#38 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2008 - 02:54 PM

Well, I can't actually...
I delete the example file, and so I can't download it at the moment either...
It's saying 'there are currently no servers available, please try again later' to me.
So if I can manage to download it later, I'll re-upload it to a different file host.

#39 Christian

Christian

    Summoner

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

Posted 23 November 2008 - 03:01 PM

no problem.
so how do I combine a global script? if you can show me and teach me i'll set off to do it myself later in the future. but right now I don't know what to put what in what line .

#40 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2008 - 03:05 PM

I'll write up a full explanation on compiling different types of global scripts at some time in the near future.
Maybe I'll even make a tutorial out of it, who knows.

#41 Christian

Christian

    Summoner

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

Posted 23 November 2008 - 03:46 PM

CODE
const int F_LADDER            = 98;        // Flag to use for ladders
const int CMB_FAIRY            = 0;    // Set here the first of the 4 Fairy combos, in the order Up, Down, Left, Right
bool HasFairy = true;
bool FairyInit = true;
int FairyMovementCounter;
int FairyMovementMax = 30;
int ScreenNumber;


//Checks for both placed and inherent flags on a location, to reduce checks
bool ComboFI(int x,int y,int combotype){
if(Screen->ComboF[ComboAt(x,y)] == combotype
|| Screen->ComboI[ComboAt(x,y)] == combotype) return true;
}

global script Slot_2{
    void run(){
        while(true){
            //Call Fairy functions
            if(HasFairy) Fairy(ScreenNumber);
            //Other global functions go here
            
            
            //Call the climbing functions
            Climbing(true);
            
            //Any utility functions go here
            ScreenNumber = Game->GetCurScreen();
            Waitdraw();
            
            //Call the climbing functions
            Climbing(false);
        Waitframe();
        }
    }

    //Fairy functions
    void Fairy(int ScreenNumber){
        ffc Fairy = Screen->LoadFFC(32);
        bool ChangeDir;
        if(FairyInit){
            Fairy->Flags[0] = true;
            Fairy->Flags[3] = true;
            Fairy->Data = CMB_FAIRY+1;
            FairyInit = false;
            Fairy->X = Rand(28) + Link->X-16;
            Fairy->Y = Rand(28) + Link->Y-16;
        }
        if(ScreenNumber != Game->GetCurScreen()){
            Fairy->X = Rand(28) + Link->X-16;
            Fairy->Y = Rand(28) + Link->Y-16;
        }
        if(FairyMovementCounter == FairyMovementMax){
            Fairy->Vx = (Rand(5)/10+0.4)*(Rand(2)*2-1);
            Fairy->Vy = (Rand(5)/10+0.4)*(Rand(2)*2-1);
            ChangeDir = true;
            FairyMovementCounter = 0;
        }
        if(Distance(Fairy->X,Fairy->Y,Link->X,Link->Y) > 32){
            if(Fairy->X < Link->X) Fairy->Vx = (Rand(5)/10+1);
            else Fairy->Vx = -(Rand(5)/10+1);
            if(Fairy->Y < Link->Y) Fairy->Vy = (Rand(5)/10+1);
            else Fairy->Vy = -(Rand(5)/10+1);
            ChangeDir = true;
        }
        if(ChangeDir){
            if(Fairy->Vy < 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY;
            else if(Fairy->Vy > 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY+1;
            else if(Fairy->Vx < 0) Fairy->Data = CMB_FAIRY+2;
            else if(Fairy->Vx > 0) Fairy->Data = CMB_FAIRY+3;
            ChangeDir = false;
        }
        FairyMovementCounter++;
    }
    
    
    //Climbing functions
    void Climbing(bool before){
        if(before){
            if(OnLadder()){
                Link->InputA = false;
                Link->InputB = false;
                Link->InputL = false;
            }
        }else{
            if(OnLadder()) Link->Dir = 0;
        }
    }
    //Check whether Link is on a ladder combo
    bool OnLadder(){
     if(ComboFI(Link->X+8,Link->Y+8,F_LADDER) && Link->Z == 0) return true;
    }
}


here is the fairy script combined with the climbing script you gave me awhile ago. can you be able to combine this and the seasonchage script for me? cause I don't want to mess everything up and change stuff just for the compiler to recognize it. pretty please icon_smile.gif



#42 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2008 - 03:53 PM

Well, have you been able to try the example quest yet?
I want to make sure it's set up how you like it first.

#43 Christian

Christian

    Summoner

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

Posted 23 November 2008 - 05:20 PM

ok the download link works . you might want to download it just in case too icon_razz.gif
just checked the quest file. Theres a bug in it. When link uses the ocarina and stops , he seems to be flashing like he is drowning or something. How do you set it up? Do the season screens to be next to each other?

Edited by drzchulo973, 23 November 2008 - 05:55 PM.


#44 lucas92

lucas92

    Defender

  • Members

Posted 23 November 2008 - 06:29 PM

The download works for me too.

Nice miniquest. icon_razz.gif

#45 Christian

Christian

    Summoner

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

Posted 24 November 2008 - 02:35 PM

Im sorry but this is so awesome! The way it appears and changes the season icon_smile.gif wow this pretty much a fully functional rod of seasons. Instead its an ocarina! You really threw yourself with this one joe icon_wink.gif can you explain how to set it up? Oh and i need
those globals combined icon_razz.gif

Never mind,I figured out how to do it icon_wink.gif

Edited by drzchulo973, 26 November 2008 - 07:22 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users