Jump to content

Photo

so my first item script (not a release, just need some help)


  • Please log in to reply
14 replies to this topic

#1 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 04 June 2008 - 01:13 PM

I'm working of course on my custom ocarina script in my spare time. i have quite a bit figured out, too.

i know there has to be some sort of trigger in the Item script to make the global part work correctly.however, i may not have set that up correctly.

also, what i am about to post is set up how i have it in use in the test quest. if you want to try to use it (which means you will have to make songs if you take it this early) then you will have to fix it up properly, and edit the ConstInt variables for your own using. this is just for refrence.

here:
CODE
//a few sample scripts. just the main ocarina and a few song string choices from OoT and MM


//==============================//
//master maniac's ocarina script//
//==============================//

//attach the following to an item (preferrably to a blank one)

import "std.zh"

bool ocarina;

item script ocarina{
    void run(){

        ocarina=true;
    }
}


//this will trigger in the global level, so paste this into your global script
//and leave out the "global script ocarina{" line.

const int dhigh= 60;  //replace these "?"s with the corresponding notes.
const int B=61;       //I have made a folder containing all of the notes and
const int A=62;       //other SFX data that i would recommend using
const int F=63;       //for this set of scripts.
const int dlow=64;

const int tile=1;    // the tile link is replaced with. (playing ocarina stance)
const int cset=1;    //the cset for the previously stated tile.


global script ocarina_player{

    void run(){

        bool ocarina;

        while(ocarina==true){
            Link->Action=LA_FROZEN;
            Screen->DrawCombo(3,Link->X, Link->Y, tile, 1, 1, cset, 0, 0, 0, 0, 0, 0, false, 128);
                
            while(Link->InputUp){
                Game->PlaySound(dhigh);
            Waitframes(5);
            }
            while(Link->InputLeft){
                Game->PlaySound(B);
            Waitframes(5);
            }
            while(Link->InputRight){
                Game->PlaySound(A);
            Waitframes(5);
            }
            while(Link->InputDown){
                Game->PlaySound(F);
            Waitframes(5);
            }
            while(Link->InputB){
                Game->PlaySound(dlow);
            Waitframes(5);
            }

            if(Link->InputA){
                Link->Action=LA_NONE;
                ocarina=false;
            }
        Waitframe();
        }        
    }
}


this is not the entire thing of course, and when i release it, I will package all the appropriate sounds in a folder along with an individual script for each song. I will not, however, supply the "link playing ocarina" tiles.

you can do that yourself. icon_razz.gif

anyway, have I linked my global and Item scripts together properly?

and if i were to make a completely new item for this (instead of using the existing whistle) how would i set it up? and how do i edit itemclasses? i know there are a few of those, but i don't understand how to make a custom item from scratch using those.

thanks for any help =)

Edited by Master Maniac, 04 June 2008 - 01:16 PM.


#2 Joe123

Joe123

    Retired

  • Members

Posted 04 June 2008 - 01:20 PM

CODE
//a few sample scripts. just the main ocarina and a few song string choices from OoT and MM
//==============================//
//master maniac's ocarina script//
//==============================//

//attach the following to an item (preferrably to a blank one)

import "std.zh"

bool ocarina;

item script ocarina{
    void run(){
        ocarina=true;
    }
}

const int dhigh= 60;  //replace these "?"s with the corresponding notes.
const int noteB=61;       //I have made a folder containing all of the notes and
const int noteA=62;       //other SFX data that i would recommend using
const int noteF=63;       //for this set of scripts.
const int dlow=64;

const int ocrtile=1;    // the tile link is replaced with. (playing ocarina stance)

            // non-animated is rubbish, plus Link is always in CSet 6 ~Joe123

global script ocarina_player{
    void run(){
        while(true){
            while(ocarina){
                Link->Action = LA_FROZEN;
                Screen->DrawCombo(3,Link->X, Link->Y, ocrtile, 1, 1, 6, 0, 0, 0, 0, 0, 0, false, 128);
                
                if(Link->InputUp){
                    Game->PlaySound(dhigh);
                Waitframes(5);
                }
                else if(Link->InputLeft){
                    Game->PlaySound(noteB);
                Waitframes(5);
                }
                else if(Link->InputRight){
                    Game->PlaySound(noteA);
                Waitframes(5);
                }
                else if(Link->InputDown){
                    Game->PlaySound(noteF);
                Waitframes(5);
                }
                else if(Link->InputB){
                    Game->PlaySound(dlow);
                Waitframes(5);
                }
                else if(Link->InputA){
                    Link->Action = 0;
                    ocarina=false;
                }
            }
        Waitframe();
        }        
    }
}

Edited by Joe123, 04 June 2008 - 01:21 PM.


#3 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 04 June 2008 - 01:29 PM

zomg joe is that really all that looks wrong with this?

that's amazing for me icon_biggrin.gif

i think this is the first thing ive cooked up on my own that DOESENT have any major mechanical flaws.
okay, i'm off to test it again.

(oh and joe, it depends on what ring he is using for the cset. and those variables were set like that so i could just see what was going on and if that was working. like i said, this was exported from my test quest.)

I think there isn't much more to do now other than fix up some songs, work out the kinks in this part, and scratch up some effects for warping.

#4 Joe123

Joe123

    Retired

  • Members

Posted 04 June 2008 - 01:38 PM

No, there's a lot of other things wrong with it too.
Like the fact that at the moment it doesn't really do anything.

I just corrected what you had there to give you a bare structure really.
You've got a lot of work left to do, at the moment it's a bit urm...
...pointless, for want of not ruining your enthusiasm.

QUOTE
(oh and joe, it depends on what ring he is using for the cset)

oh and mastermaniac, Link always uses CSet 6 whichever ring he has on.

ZC loads a sprite palette into CSet 6.



#5 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 04 June 2008 - 01:44 PM

aww... well that just means i have some work to do. i'll finish it >.<

i may just change those while(link->inputwhatevers) into if's, and supply longer sounds, instead of the crappy loopable ones. like i said, it's not really done yet. EDIT: oops, you already did that XD

so what about placing it on a blank completely custom item? how would i go about setting that up?

and i thought it just changed link's cset, instead of loading a cset into cset 6. sorry =)

Edited by Master Maniac, 04 June 2008 - 01:48 PM.


#6 Joe123

Joe123

    Retired

  • Members

Posted 04 June 2008 - 01:47 PM

I already made them into ifs.

And that's still not a very good way of doing it.
You need lots of checks and things; it's going to get horribly complex.



Make an item, set it's graphic, set it to an ItemClass that's blank (z089 or something), and just set that item class as a current item in your subscreen.
Make sure to set it's script on the action tab, rather than the pickup tab.



And have you ever tried looking at Link in CSet 7 of the main palette?

#7 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 04 June 2008 - 02:01 PM

it's going to be difficult to finish completely and to work out everything, but hopefully it shouldnt become so complex that i will have to abandon it.

i looked at CS 7 and it just looks to me like a small edit of CS 6. just like 8 too. ...should i be looking for something more?

and thank you. that should be quite a bit easier than replacing the whistle.

do you know how to track how many frames it takes for a sound to play? if i could track just one, then they would all be set (except for my other SFX for this...)

and if you think this is organized weird, you should see my template for my individual songs XD

Edited by Master Maniac, 04 June 2008 - 02:02 PM.


#8 Joe123

Joe123

    Retired

  • Members

Posted 04 June 2008 - 02:25 PM

If you put Link in CSet 7, he looks horrible is the point I was making.


Track how many frames?
Open it in a sound editing program and check the length of the song.
60 frames in a second.

#9 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 04 June 2008 - 02:43 PM

okay. i get it now XD

alright thank you. i'll post any further questions here too.

#10 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 04 June 2008 - 11:49 PM

Hah! That's pretty funny. I was sick a few months ago and scripted a "pocket piano". Link can pull a piano out his pants and play it. It has a three octave range of notes with all the 'white keys' on a keyboard.

Other features:

Allows chords (multiple notes) to be played within one octave.

And...thats it.


I never made midi notes for it and converted them to .wav. So, technically, like, It could also be a pocket guitar or harpsicord....or ...drumroll....pocket choir.


Also just for fun. Won't trigger any secrets or anything.


So: Another use for it would be to make it so you go into a house, and what?! a piano in the room? Lets go over to it, press A, and see what happens!



Also looks good.

#11 Joe123

Joe123

    Retired

  • Members

Posted 05 June 2008 - 04:14 AM

That's nice and all but how could you waste 24 of your sound effects on piano notes icon_eek.gif

We only get like 60 spare or something...

#12 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 05 June 2008 - 07:14 AM

QUOTE(Joe123 @ Jun 5 2008, 02:14 AM) View Post

That's nice and all but how could you waste 24 of your sound effects on piano notes icon_eek.gif

We only get like 60 spare or something...


Aren't you supposed to be the scripter that's the math guy?

It's 21 notes, plus I just added the ability to play 13th chords, or other combinations, and I believe we get 68 new sounds, but if you remove some of the older crappy sounds, that's about 20 more. Who's gonna use up all those sfx slots anyway?



I was thinking of sending the script to _L_ for Neofirst. I think he'd get a kick out of it if it was an organ.


Otherwise I don't really wan't to hijack the thread anymore, so if anyone wants to use it, you have to pm me.

#13 Joe123

Joe123

    Retired

  • Members

Posted 05 June 2008 - 07:20 AM

3*8 == 24.

Although there's some overlap with the octaves admittedly...
I was too lazy to work it out =P
It's 22, 3 full octaves starting and ending on C.

13th chords?
Root and 13th?
Eh?

68 isn't enough.
I can see myself getting through them.
Getting rid of the old ones is a good idea though.

Mine aren't old crappy sounds, cause I went through and updated them with nice ones from tMC and stuff =P

Edited by Joe123, 05 June 2008 - 07:20 AM.


#14 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 05 June 2008 - 07:59 AM

Yeah, you press L,R,down and B, and you get a Cmaj9. icon_smile.gif

And yeah, I ran out of button combinations for the high C. icon_frown.gif so 21. Maybe I'll make a bunch of wave files for it tomorrow. I'd never use it though, it's more of a gimmick than anything else. Maybe someone might like it though.

#15 Joe123

Joe123

    Retired

  • Members

Posted 05 June 2008 - 08:25 AM

Ah nice.

Surely having 1 octave with black notes would be better than 3 octaves without though?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users