User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Playtime-based scripts?

  1. #11
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,699
    Level
    13
    vBActivity - Bars
    Lv. Percent
    82.73%
    Quote Originally Posted by CJC View Post
    Wait... I thought secrets were by Map screen, not DMap screen. So if you have two DMap screens pointing to the same Map screen, the secret state is not carried over from one to the other?

    I'll have to play around with that.

    You're right though, if you want to do a lamp that cuts through darkness then drawing a transparent rectangle with interpolated fading rule set is the best way to do so. I was actually picturing something completely different from darkness (a dungeon with variable heat levels that becomes increasingly orange as the time counter goes on. At the harshest temperature DMap, the player's PASSIVE_Heat Heart Ring is made an active item, causing gradual damage on each screen. I know that's not what Dry Paratroopa was after, but I was thinking setup would be the same.
    I haven't looked in ages but I recall there only being one slot for dmap assignment per map.

  2. #12
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,699
    Level
    13
    vBActivity - Bars
    Lv. Percent
    82.73%
    I used scripted quick menus to eliminate the subscreen and turn it into a pause screen also, which effectively gets rid of the stop clock problem also.
    Last edited by Zim; 08-09-2014 at 03:12 PM. Reason: dual posting

  3. #13
    Aerstalfos En Passant's Avatar
    Join Date
    May 2014
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    390
    Level
    7
    vBActivity - Bars
    Lv. Percent
    18.25%
    Quote Originally Posted by Zim View Post
    Just use a draw rectangle over the whole screen with transparency. Search in the forums for and play with zim.qst for an example if you like. I wrote my own clock, time based events, nighttime, clouds, and rain scripts. There is even a lantern that works like lttp in there but it is slightly buggy only because I didn't bother to make special overhead tiles that stay dark because Link is under them at night.

    Making extra dmaps is very impractical because then you'd have to write extra scripts that trigger secrets on every map when triggered on one, which is suitable, but so is making a black transparency rectangle over the whole screen.

    Search YouTube for Zim Zelda Classic Nighttime for a short video.
    The only thing on the forum about zim.qst is this thread where the file was deleted. On YouTube, what appears to be your nighttime blacks out most of the screen, which is not what I want.
    EDIT: I can confirm that changing the DMap resets the screen, though.
    Last edited by En Passant; 08-11-2014 at 02:11 AM.

  4. #14
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,699
    Level
    13
    vBActivity - Bars
    Lv. Percent
    82.73%
    I knew that, but what you did ask about us the same thing minus the additional amounts of darkness.
    Think about it in terms of the part of the lantern that isn't blacked out all the way..
    The screen is only really dark because they are 4 shades of darkness.
    That's 4x the same thing you were pondering.
    On that same thread there are a few links to a saved version of that quest file that is only slightly outdated.
    I would be happy to post it again, but it is already there.

    Use the dropbox links to get the file, I just did and they are still there.

  5. #15
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    35
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,618
    Level
    25
    vBActivity - Bars
    Lv. Percent
    0.96%
    Quote Originally Posted by Dry Paratroopa View Post
    EDIT: I can confirm that changing the DMap resets the screen, though.
    Hmmm... did you have any room-state carry-overs set on the screen flags?

    EDIT: Nevermind, that wouldn't work, it uses Maps, not DMaps. Damn.

  6. #16
    Aerstalfos En Passant's Avatar
    Join Date
    May 2014
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    390
    Level
    7
    vBActivity - Bars
    Lv. Percent
    18.25%
    Okay, so I tried using what appears to be the rectangle that you were talking about, zim, and it doesn't work.
    CODE: Show
    global script Time{ void run(){
    bool timeValid = Game->TimeValid; //Make sure the time quest rule is enabled
    while(true){
    if(timeValid && (Game->Time-startTime)*25/9 >= 1){ //Event triggers every 60 minutes (edited to 1 for demo purposes)
    //int thisDMapScreen = Game->GetCurDMapScreen();
    if(!isNight){ //Day to night
    //int targetDMap = Game->GetCurDMap()+1; //Night DMaps are always immediately after the Day equivalents
    //Link->PitWarp(targetDMap, thisDMapScreen);
    Screen->Rectangle(6,0,0,240,0,0,160,240,160,10,true,128 );
    } else { //Night to day
    //int targetDMap = Game->GetCurDMap()-1;
    //Link->PitWarp(targetDMap, thisDMapScreen);
    }
    startTime = Game->Time; //Set startTime for the next interval
    isNight = !isNight;
    }
    Waitframe();
    }
    }
    }

  7. #17
    Octorok CaRmAgE's Avatar
    Join Date
    Oct 2008
    Location
    Historia
    Age
    35
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,332
    Level
    12
    vBActivity - Bars
    Lv. Percent
    41.63%
    Quote Originally Posted by Dry Paratroopa View Post
    Okay, so I tried using what appears to be the rectangle that you were talking about, zim, and it doesn't work.
    CODE: Show
    global script Time{ void run(){
    bool timeValid = Game->TimeValid; //Make sure the time quest rule is enabled
    while(true){
    if(timeValid && (Game->Time-startTime)*25/9 >= 1){ //Event triggers every 60 minutes (edited to 1 for demo purposes)
    //int thisDMapScreen = Game->GetCurDMapScreen();
    if(!isNight){ //Day to night
    //int targetDMap = Game->GetCurDMap()+1; //Night DMaps are always immediately after the Day equivalents
    //Link->PitWarp(targetDMap, thisDMapScreen);
    Screen->Rectangle(6,0,0,240,0,0,160,240,160,10,true,128 );
    } else { //Night to day
    //int targetDMap = Game->GetCurDMap()-1;
    //Link->PitWarp(targetDMap, thisDMapScreen);
    }
    startTime = Game->Time; //Set startTime for the next interval
    isNight = !isNight;
    }
    Waitframe();
    }
    }
    }
    That's because I believe the drawing functions only last for one frame. So, to make the effect last the entire night, add this right before Waitframe():

    CODE: Show

    if(isNight){
    Screen->Rectangle(6,0,0,240,0,0,160,240,160,10,true,128 );
    }


    or, even better, call a helper function in the if statement that makes the effect more gradual instead of instantaneous.

  8. #18
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,699
    Level
    13
    vBActivity - Bars
    Lv. Percent
    82.73%
    First thing is your booleans and other variables are not declared in this code.

    They need to be declared and set to something or they do nothing
    Secondly, a bool like isNight won't change by writing isNight=!sNight, you must write isNight= false to set it to false.
    isNight=!isNight only passes parsing because !isNight is standalone valid, but meaningless as a set.

    Thirdly, carMage is right about the waitframe, the script or function that the draw is in must be in a loop that calls the rectangle draw every frame it is active.rectangle, you would need a 64 on that argument for transparency.

    Fourthly, 128 on the transparency argument of the draw function, the last one, would draw a solid.
    Lastly, the pit warp is obsolete when using a code like that, we were talking about averting the need for ambiguous screen mimicry.

    It would be very simple,

    Code:
    
    while(true)
    { 
    if(Game->Time==Time interval of some sort)
    {Screen-> Rectangle(parameters, parameters, etc.,64);
    Waitframe();
    }
    }
    Whereas the time interval variable could be a range of numbers equating to the desired time span
    In my quest file hours are their own variable in an array.
    Last edited by Zim; 08-17-2014 at 03:55 PM.

  9. #19
    Aerstalfos En Passant's Avatar
    Join Date
    May 2014
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    390
    Level
    7
    vBActivity - Bars
    Lv. Percent
    18.25%
    Yeah, whatever Rectangle was there was completely off, I replaced it with this one:

    Screen->Rectangle(6,0,0,256,176,8,1,0,0,0,true,OP_TRANS )

    Other than that, the script worked fine with just the Screen->Rectangle being during the loop. The variables were declared before the script started, which worked somehow, but I moved them in just to be safe.

    Does ZQuest have switch-cases? The next thing I need to do is add music, and it seems tedious to have to do if statements for every overworld DMap. And how can I set it so that overlays/MIDI changes don't affect the indoors?
    Last edited by En Passant; 08-17-2014 at 08:57 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social