Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Bomb and Arrow (https://forums.graalonline.com/forums/showthread.php?t=134256880)

sssssssssss 11-10-2009 10:33 PM

Bomb and Arrow
 
Just wondering if its normal for the bomb to not show up on a gmap at all. I also have a scripted bomb, but it wont show up on the gmap either.
arrows just repeat in the level when shot, which is kinda weird.

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 --; 



if anyone would have a community bomb and arrow script that could fix this problem.

Tigairius 11-10-2009 10:40 PM

Quote:

Originally Posted by sssssssssss (Post 1537731)
Just wondering if its normal for the bomb to not show up on a gmap at all. I also have a scripted bomb, but it wont show up on the gmap either.
arrows just repeat in the level when shot, which is kinda weird.

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 --; 



if anyone would have a community bomb and arrow script that could fix this problem.

When you're on a map, it should just be player.x%64 and player.y%64, you don't need to multiply it by the gmap position, because it's already doing that by default, you have to localize it to the level.

fowlplay4 11-10-2009 10:47 PM

I think they're findable if you search the forums but this is pretty much it.

*Bomb

PHP Code:

//#CLIENTSIDE

function onWeaponfired() {
  if (
player.bombs <= 0) return;
  
player.bombs--;
  
freezeplayer(.1);
  
setani("lay",null); 
  
temp.layx player.int(player.64) * 64 .5 vecx(player.dir)*2;
  
temp.layy player.int(player.64) * 64 vecy(player.dir)*2;
  
putbomb(1temp.layxtemp.layy);


*Bow

PHP Code:

//#CLIENTSIDE

function onWeaponfired() {
  if (
player.darts <= 0) return;
  
player.darts--;
  
freezeplayer(.1);
  
setani("shoot""wbow1.png"); 
  
setshootparams("classic""arrow"player.dirplayer.account);
  
temp.angl getangle(vecx(player.dir), vecy(player.dir));
  
shoot(player.0.5 vecx(player.dir), player.vecy(player.dir), player.ztemp.angl00"classic_arrow"player.dir);
}  

function 
onActionProjectile(ptypeatypepdirpacc) {
  if (
ptype != "classic" && atype != "arrow") return;
  if (
findplayer(pacc).guild == player.guild && player.guild) return;
  
hitplayer(01player.1.5 vecx(pdir), player.vecy(pdir));


You'll have to change the gani used for the projectile in the shoot function though.

sssssssssss 11-10-2009 10:58 PM

I've searched the forums, and all I got was that bomb script I posted.
The one given in this thread works even less, the other script would take away the bombs on the gmap still, this one posted here won't do anything.

Darts neither.

DustyPorViva 11-10-2009 11:05 PM

The script posted has been personally tested and confirmed to work. Don't know what you're doing wrong, but you might have to do level.putbomb or something.

Also, be aware that if your weapons are named 'Bomb' and 'Bow' you're going to have compatibility issues with the default weapons as they will always load the default scripts first until the weapons are updated.

sssssssssss 11-10-2009 11:28 PM

I dunno what i could be doing wrong either, being you simply put the script in a weapon and add it, and change the shoot gani

sssssssssss 11-11-2009 12:35 AM

It was a space behind clientside.
The gani in the projectile, is that just the dart, is that the gani of the player shooting the arrow, or what?

DustyPorViva 11-11-2009 12:40 AM

Yup, gotta watch the spaces behind the clientside!

sssssssssss 11-11-2009 08:19 PM

Ok, so the bomb and arrow were working for about 8 hours, and now, once again, I can see absolutely nothing when I lay a bomb on the gmap. The arrows also still repeat itself on the level. Any ideas?

DustyPorViva 11-11-2009 08:31 PM

Like I said, when you log on the scripts will be overwritten with the default. You have to rename it to something other than Bow and Bomb.

sssssssssss 11-12-2009 12:03 AM

oh sorry, missed that.

sssssssssss 11-12-2009 12:10 AM

actually, did that, and on random levels, still cant see them. Some i can, some i cant.

sssssssssss 11-13-2009 04:17 AM

New for today, even though weapons "Bombs" should be adding on player log in, and has been for the last day, now its not showing up in my Q menu, even though in my attributes its in my weapons list.

Getting strange.


All times are GMT +2. The time now is 03:31 PM.

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