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 08-14-2007, 06:43 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
screwy stake

watch the vid you'll understand, all I basically did was translate the hammer script to GS2, also this is a gmap, so it might be a gmap bug?
Attached Files
File Type: zip stakes.zip (2.92 MB, 199 views)
__________________
Deep into the Darkness peering...
Reply With Quote
  #2  
Old 08-14-2007, 07:38 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by Angel_Light View Post
watch the vid you'll understand, all I basically did was translate the hammer script to GS2, also this is a gmap, so it might be a gmap bug?
u need update terrain() or something in there. i think
__________________
**FLIP OUT**
Reply With Quote
  #3  
Old 08-14-2007, 08:05 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
You need to use updateboard(x, y, width, height);
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 08-14-2007, 08:43 PM
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
I do use update board

and for some odd reason I can't post the script because it says my browser sends some unknown request to the server and the server doesn't understand. >_> (forums server)
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 08-14-2007, 09:14 PM
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
It could be because of you're on a gmap?
Also, attach the script in a txt if you want others to look at it... either way you're better off making your own hammer script as I believe the old one used board[], which tiles[] is preferred over.
Reply With Quote
  #6  
Old 08-14-2007, 09:44 PM
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
here, I tried tiles and would not even return that the tiles was stake.
Attached Files
File Type: doc hammer.doc (3.3 KB, 210 views)
__________________
Deep into the Darkness peering...
Reply With Quote
  #7  
Old 08-15-2007, 01:08 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
tiles[] is a special array that works like:
tiles[x,y]
Because it's so special, you can't copy another array into it, sadly.
Dusty is right, it might be odd because you are on a gmap.
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 08-17-2007, 03:59 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
*wait for a reply by Stefan for one of his uber awesome fixes*
__________________
Deep into the Darkness peering...
Reply With Quote
  #9  
Old 08-17-2007, 04:08 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
Just rescript it from scratch. Trying to update an old script like that for GS2 is a waste of time. You could duplicate it in such few of lines now by just rescripting it.
Reply With Quote
  #10  
Old 08-17-2007, 05:11 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
I'm not too good with how to detect tiles. Do you know a tutorial somewhere?
__________________
Deep into the Darkness peering...
Reply With Quote
  #11  
Old 08-17-2007, 05:35 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
Best way is to do something like...
PHP Code:
function onTimeout() {
  
player.chat=tiles[mousex,mousey];
  
setTimer(0.05);

And basically it's all logic from there
PHP Code:
temp.staketiles={blah,blah2,blah3,blah4}; // the four tiles for the stake
temp.downstake={blah,blah2,blah3,blah4}; // the four tiles for the stake
if (tiles[player.x,player.yin temp.staketiles) {
  
tiles[player.x,player.y]=temp.downstake[0]; 
  
updateboard(player.x,player.y,1,1);

Of course, it's more complicated than that, but you get the idea. tiles[x,y] will tell you the tile hexcode at the given coordinates, and you can also change them like so. Also, the editor will give you the hexcode of all highlighted tiles when you press the one button that looks like a circle with a + going through it.

Early apologies for the sloppy instructions, if you need something more in-depth I can do that. But hopefully this is enough to get you started.
Reply With Quote
  #12  
Old 08-17-2007, 06:57 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
ah yes plenty I get the gist of it, thanks
__________________
Deep into the Darkness peering...
Reply With Quote
  #13  
Old 08-18-2007, 07:28 PM
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
ok I got it working with tiles and it works flawless in a single level. I have deduced it is a gmap problems. let say I'm in gmap_b2.nw and I hit a stake well it updates the level gmap_a1.nw, not the level I'm in. I tried that %64 thing and it doesnt work and could someone explain to me what %64 does?
__________________
Deep into the Darkness peering...
Reply With Quote
  #14  
Old 08-18-2007, 08:00 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Angel_Light View Post
ok I got it working with tiles and it works flawless in a single level. I have deduced it is a gmap problems. let say I'm in gmap_b2.nw and I hit a stake well it updates the level gmap_a1.nw, not the level I'm in. I tried that %64 thing and it doesnt work and could someone explain to me what %64 does?
PHP Code:
function onWeaponFired() {
  
player.chat player.x SPC " - " SPC player.y;

PHP Code:
function onWeaponFired() {
  
player.chat player.x%64 SPC " - " player.y%64;

Try both the scripts on a gmap and you'll see it :P
__________________
Reply With Quote
  #15  
Old 08-18-2007, 10:08 PM
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
Well, % is modulus, which is the remainder of division.
So on a gmap, the gmap acts as one giant level, so instead of your coordinates being from 0-64, it's 64*amount of gmap levels+player's actual coordinates in the level.
So... if you want the coordinates of the player in the actual level, not gmap, you'd do player.x%64 which translates to divide the player's x by 64, and return the remainder, which in this case would be the player's coordinates in relation to the level, not the gmap.

Also, you might want to try this, along with the player.x/y%64:
level.tiles[blah,blah]
level.updateboard(x,y,2,2);
Reply With Quote
  #16  
Old 08-19-2007, 01:30 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
level. on serverside is a gmap (if you are in one) while it is a single level on the clientside so you don't want to use modulus.
__________________
Do it with a DON!
Reply With Quote
  #17  
Old 08-20-2007, 02:29 AM
Rufus Rufus is offline
Registered User
Join Date: Jun 2004
Location: United Kingdom
Posts: 4,698
Rufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud of
I'm confused now. What did a stake turn into when pressed, the sign hole?
__________________
Quote:
Originally Posted by Loriel View Post
Seriously, you have ****-all for content and you're not exactly pulling in new developer talent, angling for prestigious titles should be your last concern.
Reply With Quote
  #18  
Old 08-20-2007, 03:05 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
it works I got it, I just used tiles instead of board (did the little conversion between the two) and then I completely removed that modulus thing. thanks guys, would rep but it says I need to spread some around first XD lol
EDIT Yes rufus
__________________
Deep into the Darkness peering...
Reply With Quote
  #19  
Old 08-20-2007, 02:15 PM
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
thanks guys, would rep but it says I need to spread some around first XD lol
I hate that especially since I still get that with people that I have repped 10 or so other people after I repped them...
__________________
Do it with a DON!
Reply With Quote
  #20  
Old 08-20-2007, 02:25 PM
Rufus Rufus is offline
Registered User
Join Date: Jun 2004
Location: United Kingdom
Posts: 4,698
Rufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud of
Quote:
Originally Posted by Angel_Light View Post
EDIT Yes rufus
Oh. Should use something like this:

__________________
Quote:
Originally Posted by Loriel View Post
Seriously, you have ****-all for content and you're not exactly pulling in new developer talent, angling for prestigious titles should be your last concern.
Reply With Quote
  #21  
Old 08-20-2007, 09:42 PM
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
I made tiles nearly like that ;p
__________________
Deep into the Darkness peering...
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 08:23 PM.


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