Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2012, 07:11 PM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
Bombs on Gmap

How do I get bombs to show up on the gmap? For some reason my bombs aren't showing up on the gmap!
Reply With Quote
  #2  
Old 03-18-2012, 08:05 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
post your script. the fix is often putbomb(1, x % 64, y % 64).
__________________
Quote:
Reply With Quote
  #3  
Old 03-19-2012, 01:40 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by fowlplay4 View Post
post your script. the fix is often putbomb(1, x % 64, y % 64).
I think the behaviors are different on v5 and v6, where one is expecting GMAP x/y and the other expects level x/y
Reply With Quote
  #4  
Old 03-19-2012, 03:42 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
This is what I have, I just implemented what you gave me:

NPC Code:
//#CLIENTSIDE
function onWeaponFired()
{
if (player.dir=0){ putbomb(1, x+0.5 % 64, y-1 % 64); }
if (player.dir=1){ putbomb(1, x-1.5 % 64, y+1 % 64); }
if (player.dir=2){ putbomb(1, x+0.5 % 64, y+2.5 % 64); }
if (player.dir=3){ putbomb(1, x+2.5 % 64, y+1 % 64); }
player.bombs - 1;
}

__________________

Yep.

Reply With Quote
  #5  
Old 03-19-2012, 05:49 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
you should

A.) check the player has enough bombs before placing it
B.) reference the object to whose x/y you're referring (player.x, player.y);
C.) add else statements between each if so 4 evals aren't made every time.
Reply With Quote
  #6  
Old 03-19-2012, 06:24 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Mark Sir Link View Post
you should

A.) check the player has enough bombs before placing it
B.) reference the object to whose x/y you're referring (player.x, player.y);
C.) add else statements between each if so 4 evals aren't made every time.
D.) player.bombs -= 1;
You may or may --^
not be able to see the bold here.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #7  
Old 03-19-2012, 06:26 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by r3ckless View Post
This is what I have, I just implemented what you gave me:

NPC Code:
//#CLIENTSIDE
function onWeaponFired()
{
if (player.dir=0){ putbomb(1, x+0.5 % 64, y-1 % 64); }
if (player.dir=1){ putbomb(1, x-1.5 % 64, y+1 % 64); }
if (player.dir=2){ putbomb(1, x+0.5 % 64, y+2.5 % 64); }
if (player.dir=3){ putbomb(1, x+2.5 % 64, y+1 % 64); }
player.bombs - 1;
}

IŽd do it like this (also what Mark explained)
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.bombs 0) {
    if (
player.dir == 0putbomb(1player.0.5 64player.64);
    if (
player.dir == 1putbomb(1player.1.5 64player.64);
    if (
player.dir == 2putbomb(1player.0.5 64player.2.5 64);
    if (
player.dir == 3putbomb(1player.2.5 64player.64);
    
player.bombs -= 1;
  }

but instead of having the check of every single direction of the player, IŽd suggest you to get familiar with vecx() and vecy(). Here is a great explanation made by Tigairius
http://forums.graalonline.com/forums...highlight=vecx
__________________
MEEP!
Reply With Quote
  #8  
Old 03-19-2012, 07:33 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
yeah i fogot to add player. but I added that right after, and it works good. thank you guys.

I also added the bomb check to make sure player has bombs.
__________________

Yep.

Reply With Quote
  #9  
Old 03-19-2012, 07:36 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
And I still can't understand the vecx and vecy for some reason x.x
__________________

Yep.

Reply With Quote
  #10  
Old 03-19-2012, 07:41 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
So now I have this and it still doesn't place the bomb on the gmap:

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.bombs 0) {
    if (
player.dir == 0){ putbomb(1player.0.5 64player.64); }
    if (
player.dir == 1){ putbomb(1player.1.5 64player.64); }
    if (
player.dir == 2){ putbomb(1player.0.5 64player.2.5 64); }
    if (
player.dir == 3){ putbomb(1player.2.5 64player.64); }
    
player.bombs -= 1;
  }

__________________

Yep.

Reply With Quote
  #11  
Old 03-19-2012, 07:47 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
idk what version of Graal you're using but like I said there was a weird behavior between v5 and v6 where one expects a level x y, and the other expects a gmap x y
Reply With Quote
  #12  
Old 03-19-2012, 07:50 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
PHP Code:
//#CLIENTSIDE

function onWeaponFired() {
  
player.ani "Grab";
  
temp.bombposx player.vecx(player.dir);
  
temp.bombposy player.vecy(player.dir);
  
  
putbomb(1,temp.bombposx,temp.bombposy);

This works for me on GMAPs and normal levels. The triggeraction doesn't place the bomb perfectly, but I'm sure you can tweak about with it. I'm sure you can add bomb checks and such in by yourself too.
__________________
Reply With Quote
  #13  
Old 03-19-2012, 10:33 PM
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
Quote:
Originally Posted by r3ckless View Post
And I still can't understand the vecx and vecy for some reason x.x
vecx(player.dir),vecy(player.dir) will basically mimc the direction in which your player is standing. Of course it's much more useful then that.

thing of the results from vecx and vecy as points on a cartesian graph


value| vecx | vecy | corresponding direction
0 | 0 | -1 | up
1 | -1 | 0 | left
2 | 0 | 1 | down
3 | 1 | 0 | right

soz I had neat columns and the forums took them away
Reply With Quote
  #14  
Old 03-19-2012, 10:54 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Just for you trix
__________________
Reply With Quote
  #15  
Old 03-20-2012, 05:07 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
ah thanks guys.
yeah i can tweak it to my needs. Thanks Emera
__________________

Yep.

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 02:29 PM.


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