Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-14-2011, 08:49 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
Bombs and Bows

Can anybody tell me how to add bombs and arrows weapons to my playerworld please? Like the default weapons on Classic iPhone
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #2  
Old 05-14-2011, 09:38 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
.....?
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #3  
Old 05-14-2011, 11:59 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You script them.

As *Bow and/or *Bomb, and add them using addweapon to player.

Important Functions:
shootarrow(dir);
putbomb(power, x, y);

Search the forums they're probably out there already.
__________________
Quote:
Reply With Quote
  #4  
Old 05-15-2011, 12:00 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
arent there problems with the gmap and default bows and arrows though?
__________________
Quote:
Originally Posted by Crono View Post
No look at it, Stefan is totally trolling Thor. Calling Classic a "playerworld" (something it's not supposed to be) is the ultimate subtle insult to a true fan.

It's genius.
Reply With Quote
  #5  
Old 05-15-2011, 12:02 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Tricxta View Post
arent there problems with the gmap and default bows and arrows though?
On V5, V6 is fine though.

I posted them before here:
http://forums.graalonline.com/forums...36&postcount=3
__________________
Quote:
Reply With Quote
  #6  
Old 05-15-2011, 01:01 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
I think you can just add yourself Bombs and Bow...
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
  #7  
Old 05-15-2011, 01:45 AM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Quote:
Originally Posted by MattKan View Post
I think you can just add yourself Bombs and Bow...
You can edit your attributes, but you still need to script the weapon to use them.
Reply With Quote
  #8  
Old 05-15-2011, 01:50 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Soala View Post
You can edit your attributes, but you still need to script the weapon to use them.
I could be wrong but I think if you add yourself Bow and Bomb the default ones will work. I would rescript them anyway.
__________________
Reply With Quote
  #9  
Old 05-15-2011, 02:01 AM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
I could be wrong but I think if you add yourself Bow and Bomb the default ones will work. I would rescript them anyway.
How do they work if the wNPC is not on the server? Are default bombs and bow used from a seperate file, like in the level editor?
Reply With Quote
  #10  
Old 05-15-2011, 02:07 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Soala View Post
How do they work if the wNPC is not on the server? Are default bombs and bow used from a seperate file, like in the level editor?
Pretty sure it's just something special in the client that makes those work. I could, of course, be wrong.
__________________
Reply With Quote
  #11  
Old 05-15-2011, 02:42 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The default weapons are implemented with built-in scripts, if you want to write a custom one then you need to use a different weapon name.
I'm not sure if we have already posted the default scripts, but they are quite simple, here the bomb and bow:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.bombs<=0)
    return;
  if (
player.dir==0putbomb(1,player.x+0.5,player.y-1);
  if (
player.dir==1putbomb(1,player.x-1.5,player.y+1);
  if (
player.dir==2putbomb(1,player.x+0.5,player.y+2.5);
  if (
player.dir==3putbomb(1,player.x+2.5,player.y+1);
  
player.bombs--;

PHP Code:
///#CLIENTSIDE
function onWeaponFired() {
  if (
player.darts<=0)
    return;
  
freezeplayer(0.3);
  
setani("shoot","wbow1.png");
  
setTimer(0.25);
}
function 
onTimeout() {
  
shootarrow(player.dir);
  
player.darts--;

Reply With Quote
  #12  
Old 05-19-2011, 05:53 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
what would be the NPC code to add bombs to a player... as in if somebody said "10 bombs" it would add 10 bombs to the player?
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #13  
Old 05-19-2011, 06:49 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
PHP Code:
function onCreated(){
  
setshape(1,32,32);   //Set the shape of the NPC serverside so the triggeractions work.
}

function 
onActionGiveBombs(bombrequest){   // Executing the GiveBombs action.
  
if((99 player.bombs) > bombrequest){
    
player.bombs += bombrequest;
    
player.chat "You received "@bombrequest SPC "bombs!";
  }
  else {
    
player.bombs += 99 player.bombs;
  }
}

function 
onActionGiveArrows(arrowrequest){   // Executing the GiveArrows action.
  
if((99-player.darts) > arrowrequest){
    
player.darts += arrowrequest;
    
player.chat "You received "@arrowrequest SPC "arrows!";
  }
  else {
    
player.darts += 99-player.darts;
  }
}

//#CLIENTSIDE

function onCreated(){
  
setshape(1,32,32);
}

function 
onPlayerChats(){
  
temp.tokens player.chat.tokenize();   // Tokenizing each word in the player's chat.
  
if(temp.tokens[0] > && temp.tokens[0] <= 99){   // Checking if the requested amount is more than 0 and less than or equal to 99.
    
if(temp.tokens[1] == "bombs"){   // Checking if the player asked for bombs or arrows.
      
triggeraction(this.x+.5,this.y+.5,"GiveBombs",temp.tokens[0]);   // Triggering the GiveBombs function on the serverside.
    
}
    else if(
temp.tokens[1] == "arrows"){
      
triggeraction(this.x+.5,this.y+.5,"GiveArrows",temp.tokens[0]);   // Triggering the GiveArrows function on the serverside.
    
}
  }

This script adds both bombs and arrows, depending on what the second word is in you chat. It works in a level NPC.
Bombs and arrows can only be added serverside, which is why the triggeractions are placed in the script.
Your welcome.
__________________

Intelligence without ambition is like a bird without wings.


Last edited by iBeatz; 05-19-2011 at 07:01 PM.. Reason: Error in script.
Reply With Quote
  #14  
Old 05-19-2011, 06:52 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by iBeatz View Post
This script adds both bombs and arrows, depending on what the second word is in you chat. It works in a level NPC.
Bombs and arrows can only be added serverside, which is why the triggeractions are placed in the script.
Your welcome.
This script is good if bombs/arrows are not a big deal to your server (like, not a major part of the economy or anything), but the script is bad if you don't want players to get 99 free arrows/bombs. I say this, because the triggers in your script on the clientside are insecure, you shouldn't pass the value of bombs/arrows from the clientside because they can be edited with memory editors by players.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #15  
Old 05-19-2011, 07:06 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
I did it that way because he did not specify that he wanted gralats to be deducted.
And what in God's name is a memory editor? o_o
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.