PDA

View Full Version : screwy stake


Angel_Light
08-14-2007, 06:43 AM
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?

theHAWKER
08-14-2007, 07:38 AM
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 :D

zokemon
08-14-2007, 08:05 AM
You need to use updateboard(x, y, width, height);

Angel_Light
08-14-2007, 08:43 PM
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)

DustyPorViva
08-14-2007, 09:14 PM
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.

Angel_Light
08-14-2007, 09:44 PM
here, I tried tiles and would not even return that the tiles was stake.

zokemon
08-15-2007, 01:08 AM
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.

Angel_Light
08-17-2007, 03:59 AM
*wait for a reply by Stefan for one of his uber awesome fixes*

DustyPorViva
08-17-2007, 04:08 AM
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.

Angel_Light
08-17-2007, 05:11 AM
I'm not too good with how to detect tiles. Do you know a tutorial somewhere?

DustyPorViva
08-17-2007, 05:35 AM
Best way is to do something like...
function onTimeout() {
player.chat=tiles[mousex,mousey];
setTimer(0.05);
}
And basically it's all logic from there
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.y] in 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.

Angel_Light
08-17-2007, 06:57 AM
ah yes plenty I get the gist of it, thanks ^^

Angel_Light
08-18-2007, 07:28 PM
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?

Chompy
08-18-2007, 08:00 PM
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?


function onWeaponFired() {
player.chat = player.x SPC " - " SPC player.y;
}



function onWeaponFired() {
player.chat = player.x%64 SPC " - " @ player.y%64;
}


Try both the scripts on a gmap and you'll see it :P

DustyPorViva
08-18-2007, 10:08 PM
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);

zokemon
08-19-2007, 01:30 AM
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.

Rufus
08-20-2007, 02:29 AM
I'm confused now. What did a stake turn into when pressed, the sign hole?

Angel_Light
08-20-2007, 03:05 AM
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

zokemon
08-20-2007, 02:15 PM
^^ 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...

Rufus
08-20-2007, 02:25 PM
EDIT Yes rufus

Oh. Should use something like this:

http://img135.imageshack.us/img135/548/hammerstakeja1.png

Angel_Light
08-20-2007, 09:42 PM
I made tiles nearly like that ;p