How do I do this? After looking in Std.zh, I've tried using the itemclass-> command, but I'm not sure of the syntax.
Checking how many Rupees Link has
Started by
Joe123
, Sep 28 2007 01:07 PM
4 replies to this topic
#1
Posted 28 September 2007 - 01:07 PM
#2
Posted 28 September 2007 - 02:30 PM
nevermind
sorry
Edited by Octorockoncrack, 28 September 2007 - 02:31 PM.
#3
Posted 28 September 2007 - 02:52 PM
¬_¬ no. I'm talking about scripting
I want to know the command that I put in the script to work out how many rupees it has at a given time.
I want to know the command that I put in the script to work out how many rupees it has at a given time.
#4
Posted 28 September 2007 - 04:31 PM
Hmm...
That'd be Game->Counter[] and Game->MCounter[] you'd be wanting. They use the CR_ constants in std.zh, despite what they say they do in zscript.txt. (CT_ constants are combo types. ._.)
That'd set Link's Max Rupees to 999.
That sets Link's Rupees to the current Max.
You get the idea. Use Game->Counter[1] to get Link's Current Rupees and Game->MCounter[1] for Max Rupees.
That'd be Game->Counter[] and Game->MCounter[] you'd be wanting. They use the CR_ constants in std.zh, despite what they say they do in zscript.txt. (CT_ constants are combo types. ._.)
CODE
Game->MCounter[1] = 999;
That'd set Link's Max Rupees to 999.
CODE
Game->Counter[1] = Game->MCounter[1];
That sets Link's Rupees to the current Max.
You get the idea. Use Game->Counter[1] to get Link's Current Rupees and Game->MCounter[1] for Max Rupees.
#5
Posted 28 September 2007 - 04:40 PM
So if(Game->Counter[1] == 0){
would work only if Link has no rupees, correct?
and it said that I needed to use itemclass in std.zh ah well
Thanks matthew.
EDIT: Apparently it does work because I tried it.
Oh yeah
would work only if Link has no rupees, correct?
and it said that I needed to use itemclass in std.zh ah well
Thanks matthew.
EDIT: Apparently it does work because I tried it.
CODE
ffc script real_npc_heal_ammo { //open script
void run(int s, int f, int d, int def_dir, int l, int m, int n, int o) { //open void run
int d_x;
int d_y;
int a_x;
int a_y;
int orig_d = this->Data;
if(d == 0) d = 48;
while(true) { //open while loop
d_x = this->X - Link->X;
d_y = this->Y - Link->Y;
a_x = Abs(d_x);
a_y = Abs(d_y);
if(f != 0) { //open if
if(a_x < d && a_y < d) { //open if
if(a_x <= a_y) { // open if
if(d_y >= 0) { //open if
this->Data = orig_d + DIR_UP;
} else { //close if open else
this->Data = orig_d + DIR_DOWN;
} // close else
} else { //close if open else
if(d_x >= 0) { //open if
this->Data = orig_d + DIR_LEFT;
} else { //close if open else
this->Data = orig_d + DIR_RIGHT;
} //close else
} //close if
} else { //close if open else
this->Data = orig_d + def_dir;
} //close if
} //close if
if(Link->InputL && a_x < 24 && a_y < 24) {
if(Link->HP <=64){ //open if 1 (HP)
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(l);
Link->InputL = false;
} //close if 1
else{ //open else 1
if(Game->Counter[1] == 0){ //open if 2 (Rupees)
Game->Counter[1] = Game->Counter[1] +10;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(m);
Link->InputL = false;
} //close if 2
else{ //open else 2
if(Link->HP <=64 && Game->Counter[1] == 0){ //open if 3 (HP & Rupees)
Game->Counter[1] = 10;
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(n);
Link->InputL = false;
} //close if 3
else{ //open else 3
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(o);
Link->InputL = false;
} //close else 1
} //close else 2
} //close else 3
} // close if
Waitframe();
} // close while loop
} //close void run
} //close script
void run(int s, int f, int d, int def_dir, int l, int m, int n, int o) { //open void run
int d_x;
int d_y;
int a_x;
int a_y;
int orig_d = this->Data;
if(d == 0) d = 48;
while(true) { //open while loop
d_x = this->X - Link->X;
d_y = this->Y - Link->Y;
a_x = Abs(d_x);
a_y = Abs(d_y);
if(f != 0) { //open if
if(a_x < d && a_y < d) { //open if
if(a_x <= a_y) { // open if
if(d_y >= 0) { //open if
this->Data = orig_d + DIR_UP;
} else { //close if open else
this->Data = orig_d + DIR_DOWN;
} // close else
} else { //close if open else
if(d_x >= 0) { //open if
this->Data = orig_d + DIR_LEFT;
} else { //close if open else
this->Data = orig_d + DIR_RIGHT;
} //close else
} //close if
} else { //close if open else
this->Data = orig_d + def_dir;
} //close if
} //close if
if(Link->InputL && a_x < 24 && a_y < 24) {
if(Link->HP <=64){ //open if 1 (HP)
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(l);
Link->InputL = false;
} //close if 1
else{ //open else 1
if(Game->Counter[1] == 0){ //open if 2 (Rupees)
Game->Counter[1] = Game->Counter[1] +10;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(m);
Link->InputL = false;
} //close if 2
else{ //open else 2
if(Link->HP <=64 && Game->Counter[1] == 0){ //open if 3 (HP & Rupees)
Game->Counter[1] = 10;
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(n);
Link->InputL = false;
} //close if 3
else{ //open else 3
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(o);
Link->InputL = false;
} //close else 1
} //close else 2
} //close else 3
} // close if
Waitframe();
} // close while loop
} //close void run
} //close script
Oh yeah
Edited by Joe123, 28 September 2007 - 06:04 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users