Jump to content

Photo

Secrets triggered by strings

Secrets Strings Schtuff

  • Please log in to reply
11 replies to this topic

#1 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 06 June 2016 - 01:55 AM

Greetings once again my fellow Zeldians~! I have a question for you all.

 

Is there a way to have a secret triggered only after you've seen a certain message string? I feel like that would be a string command, but apparently, there is no such command for that. Would I need a script for such a command? If so, would it be so hard for any of you script wizards to write one for a dumb dumb like me? 

 

Thank you for your time~



#2 Gégé

Gégé

    Senior

  • Members
  • Real Name:Gérard
  • Location:France

Posted 06 June 2016 - 04:01 AM

By LinktheMaster

// This is the active global script
global script globalScript
{
    void run()
    {
        // Set the string secret counter's max value to allow it to be changed
        Game->MCounter[SECRET_COUNTER] = 5;
        
        while(true)
        {
            // Activate string secrets
            stringSecrets();
            Waitframe();
        }
    }
}

// Set this to the counter you want to use
int SECRET_COUNTER = CR_SCRIPT1;

// This function activates screen secrets when the given
// counter is not 0. Use \12\COUNTER\1 to activate
// the secrets. (CR_SCRIPT1 would be \12\7\1)
// Use the CR_ constants in std.zh to determine which
// counter to use.
void stringSecrets()
{
    // If the secret counter was incremented
    if(Game->Counter[SECRET_COUNTER] > 0)
    {
        // Activate secrets
        Screen->TriggerSecrets();
        Game->Counter[SECRET_COUNTER] = 0;
        Game->PlaySound(SFX_SECRET);
    }
}

http://www.purezc.ne...showtopic=56471


Edited by Gégé, 06 June 2016 - 04:01 AM.

  • ShadowTiger likes this

#3 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 06 June 2016 - 08:26 AM

Thanks for your efforts, but would there possibly be a way to do this without global scripting? I haven't a clue how to use global scripts, and I think I kinda want to keep my game as simple as possible... 

 

If there isn't another way, I can try and learn the way of the global script, but it might end in humiliation and failure...



#4 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 06 June 2016 - 08:39 AM

Well global scripting only gets complicated if you want to use more than 1 different global script so you'd have to combine them.

 

Also, you could actually just replace "global" with "ffc" and it would be an FFC script instead, which you have to place on every screen you want to use it in.



#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 June 2016 - 08:40 AM

Thanks for your efforts, but would there possibly be a way to do this without global scripting? I haven't a clue how to use global scripts, and I think I kinda want to keep my game as simple as possible... 
 
If there isn't another way, I can try and learn the way of the global script, but it might end in humiliation and failure...


Sorry, no. ZC doesn't track secret activations in that manner by default, at all.

#6 Gégé

Gégé

    Senior

  • Members
  • Real Name:Gérard
  • Location:France

Posted 06 June 2016 - 10:29 AM

Thanks for your efforts, but would there possibly be a way to do this without global scripting? I haven't a clue how to use global scripts, and I think I kinda want to keep my game as simple as possible... 

 

If there isn't another way, I can try and learn the way of the global script, but it might end in humiliation and failure...

Or If you prefer ffc, take a npc script for show a message and triggered secret.

 

Original by Joe123

D0 is the message string to play
D1 is which button to check for when reading the singpost, 0 is A, 1 is B, 2 is L and 3 is R

Spoiler

Edited by Gégé, 06 June 2016 - 10:52 AM.


#7 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 06 June 2016 - 03:44 PM

Or If you prefer ffc, take a npc script for show a message and triggered secret.

 

Original by Joe123

D0 is the message string to play
D1 is which button to check for when reading the singpost, 0 is A, 1 is B, 2 is L and 3 is R

Spoiler

Huh. I didn't know that was a function with that script. I'll mess around later, thanks~!

 

Also, you could actually just replace "global" with "ffc" and it would be an FFC script instead, which you have to place on every screen you want to use it in.

Would that actually work? I'll have to try that when I can get on my PC... 



#8 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 07 June 2016 - 05:34 AM

Yeah, that script Gege posted is a modified signpost that will trigger secrets.



#9 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 07 June 2016 - 07:35 AM

Yeah, that script Gege posted is a modified signpost that will trigger secrets.

It worked, but the secret was only temporary. Is there a way to make it permanent? The secret in question was opening up a shutter, but when I try and go back, the shutter is closed again, trapping me, which isn't very nice.



#10 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 07 June 2016 - 07:45 AM

It worked, but the secret was only temporary. Is there a way to make it permanent? The secret in question was opening up a shutter, but when I try and go back, the shutter is closed again, trapping me, which isn't very nice.

 

That's an error in the script. In the script there's this line:

Screen->State[ST_SECRET]==true;

Remove one of the "=".


  • Gégé likes this

#11 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 07 June 2016 - 07:48 AM

That's an error in the script. In the script there's this line:

Screen->State[ST_SECRET]==true;

Remove one of the "=".

It's working just how I want it now. Thank you so much, guys <3


  • Avaro and Gégé like this

#12 Gégé

Gégé

    Senior

  • Members
  • Real Name:Gérard
  • Location:France

Posted 07 June 2016 - 08:23 AM

It's working just how I want it now. Thank you so much, guys <

 
Forgive me, I forgot to say that it was temporary :).

  • Tree likes this



Also tagged with one or more of these keywords: Secrets, Strings, Schtuff

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users