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:
//==============================//
//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.
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.