Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-26-2007, 03:56 AM
HazeOfTime HazeOfTime is offline
Registered User
Join Date: Dec 2006
Posts: 44
HazeOfTime is on a distinguished road
Bomb & Bow

Does anyone have the default bomb and bow script, like the one used in classic?
Reply With Quote
  #2  
Old 06-26-2007, 04:06 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
cant you use the default ones or do want to see the script? I'm not sure hwo they do there bow probably just shootarrow and stuff here's how I would do bombs

PHP Code:
//#CLIENTSIDE
function onWeaponFired() { 
if (
player.bombs 0) { 
  
setani("lay"NULL); 
  
freezeplayer(0.2); 
if (
isOnMap) { 
  
temp.px player.- (64 getMapX(player.level)) + 0.5 vecx(player.dir)*2
  
temp.py player.- (64 getMapY(player.level)) + 0.5 vecy(player.dir)*2
  
putBomb(1temp.pxtemp.py); 

else { 
  
putbomb(1,player.vecx(player.dir)*2player.0.5 vecy(player.dir)*2); 

  
player.bombs --; 


__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 06-26-2007, 04:12 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Why do you have to do all that detection for the player if they're on the map?
Last time I checked player.x/y gave the coordinates relative to the player on the gmap.
Reply With Quote
  #4  
Old 06-26-2007, 04:15 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
if your in the top left level it does otherwise it doesnt
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 06-26-2007, 04:20 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Hmmm, odd, I've never had that problem.
Reply With Quote
  #6  
Old 06-26-2007, 06:57 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Angel_Light View Post
cant you use the default ones or do want to see the script? I'm not sure hwo they do there bow probably just shootarrow and stuff here's how I would do bombs

PHP Code:
//#CLIENTSIDE
function onWeaponFired() { 
if (
player.bombs 0) { 
  
setani("lay"NULL); 
  
freezeplayer(0.2); 
if (
isOnMap) { 
  
temp.px player.- (64 getMapX(player.level)) + 0.5 vecx(player.dir)*2
  
temp.py player.- (64 getMapY(player.level)) + 0.5 vecy(player.dir)*2
  
putBomb(1temp.pxtemp.py); 

else { 
  
putbomb(1,player.vecx(player.dir)*2player.0.5 vecy(player.dir)*2); 

  
player.bombs --; 


Much shorter version:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.bombs <= 0) return; 
  
setani("lay""");
  
freezeplayer(0.2);
  
putBomb(1player.x%64 0.5 vecx(player.dir)*2player.y%64 vecy(player.dir)*2);
  
player.bombs --; 

Good use of math reduces the need to use if checks.
And why did you have + 0 on the Y for the map and + 0 on the x and + 0.5 for the Y off a map?
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 06-29-2007, 08:13 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Psh. Math.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:39 AM.


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