I want to make a mine where the player can collect Ores.
But i don’t know what to do!!!
Can you give me an advice or two?
-Vulcro-
I want to make a mine where the player can collect Ores.
But i don’t know what to do!!!
Can you give me an advice or two?
-Vulcro-
When you fire the weapon on a wall or on a npc depends on what you want (I would go with using triggeraction on a NPC image.)
Have it send the trigger then have a counter that goes down every time you hit the NPC after say 10 hits have something like this.ran_mineral = int(random(0,10));
have a few ifs checking what those numbers are so if (this.ran_mineral == 0)setplayerprop #c,There is nazziing!;
else if (this.ran_mineral == 1)setplayerprop #c,Woot coal; client.coal++;
Something along those lines. That’s just a basic explanation.
[QUOTE=Chicken;11762]
When you fire the weapon on a wall or on a npc depends on what you want (I would go with using triggeraction on a NPC image.)
Have it send the trigger then have a counter that goes down every time you hit the NPC after say 10 hits have something like this.ran_mineral = int(random(0,10));
have a few ifs checking what those numbers are so if (this.ran_mineral == 0)setplayerprop #c,There is nazziing!;
else if (this.ran_mineral == 1)setplayerprop #c,Woot coal; client.coal++;
Something along those lines. That’s just a basic explanation.
[/QUOTE]
Isn’t it easier to just use a flag, you know, for it to save onto the player?
Ok but can i have a french translation, cause my English has limits!
EDIT: i think i can do that! I understand a little…
Edit2: Can you give me a complete script? It will help me to learn scripting, and it will be more quick!
Hmmm from memory did the command tokenize work well for this?
Have you downloaded the Graal DVD? I believe the pizza scripts could be modified, possibly the hammer script for your pick axe…
I’m pretty sure chicken allready explained it well enough.
First time I saw it done was on Damasca, which utilized 2 npcs.
The first, is the system that tells you (thru a chat text or display on hud) the amount of ore you’ve collected.
if(weaponfired){ // make players chat say the string holding Ore count.
setplayerprop #c,#v(#s(client.oreamount)));
}
The 2nd, is the axe or pick you use to collect ore.
if(weaponfired){
showani pickaxe;
if(playerstrequals(#L,mine.nw)){
this.y=0;
this.x=int(random(1,10));
if(this.x>1){
setplayerprop #c,you got nothing!;
}else{
this.y=#v(playerstrequals(#s,client.ore));
this.y=this.y+1;
replacestring client.ore,0,#v(this.y);
setplayerprop #c,You found an ore!;
}
}
sleep 1;
showani default;
}
Thats not really accurate wording on the code in some parts i’m sure. I havn’t scripted anything in awhile. but basically that’s all you need. You just replicate a few of the lines if you want multiple ore types like Gold, Silver, Platinum. In retrospect, i’m certain there is a thread allready about this on the npc section of the forum.
Edit: http://forums.graal.in/forums/showthread.php?t=294 is what I was thinking of. It’s nearly an identical idea, minus the part about being on a mining level. The npc forum has tons of useful npcs allready made, its in the development section of the forum, then under the subforum npcs (there are also a few topics just under the development section).
If your only seeing 1 or 2 topics, Make sure your forum is set to show older topics. There is atleast 4 pages of npc topics.
[QUOTE=Nalin;11844]playerstrequals?[/QUOTE]
He seems to have a running typo.
lol, told ya it wasn’t exact wording. Perhaps the player part was never part of strequals.
So, can someone give me a script wich is complete?
This is hard for me! :s I know i should search by myself …
But it doesn’t work when i change some var and other…
I precise: I want the players to collect with a lvl4 sword or more.
[QUOTE=Raster;11862]
So, can someone give me a script wich is complete?
This is hard for me! :s I know i should search by myself …
But it doesn’t work when i change some var and other…
I precise: I want the players to collect with a lvl4 sword or more.
[/QUOTE]
Here you go (btw I just edited the script for you)
if(playertouchsme){
toweapons Pickaxe/Lvl 4 Sword;
}
if(weaponfired){
showani lvl_four_sword;//You'll need to find a gani...
if(playerstrequals(#L,mine.nw)){
this.y=0;
this.x=int(random(1,10));
if(this.x>1){
setplayerprop #c,you got nothing!;
}else{
this.y=#v(playerstrequals(#s,client.ore));
this.y=this.y+1;
replacestring client.ore,0,#v(this.y);
setplayerprop #c,You found an ore!;
}
}
sleep 1;
showani default;
}
You are definitely retarded like hell for replying to a 2 year dead thread.
-1 thanks for you.
Now stop replying to npc threads that are burried under some other threads for atleast 1 month.