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 05-24-2007, 03:31 AM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
binocular action

PHP Code:
function scope()
{
//scope function - triggered through onkeypressed
client.freezetime = -1;
this.xmod playerx;
this.ymod playery;
this.scopeon true;

onTimeout();
}

function 
onTimeout()
{
if (
this.scopeon) { setfocus(this.xmod,this.ymod); player.chat format("x-%d,y-%d",this.xmod,this.ymod); }

setTimer(.05);
}

function 
unscope()
{
this.scopeon false;
client.freezetime 0;
resetfocus();
setTimer(0);
}
function 
onKeyPressed(keycodekeyname)
{
 switch (
keyname)
 {
  
//scope xy modifiers
  
case "i"this.ymod += 1; break;
  case 
"j"this.ymod -= 1; break;
  case 
"k"this.xmod -= 1; break;
  case 
"l"this.xmod += 1; break;

  case 
"f"scope(); break;
  case 
"g"unscope(); break;
 }

What this is supposed to do, is to act like binoculars - the onkeypressed call giving the respective keys control over the view, by increasing xmod or ymod (which the setfocus is supposed to be derived from in the first place) when pressed. However, it's not working. To my knowledge, onkeypressed is called whenever the key is pressed, so there's really no excuse for it not to be working - as far as my logic chain goes.

Assistance here would be lovely. I honestly can't figure out why this isn't working, and I'm sure some of you scriptgods would love the opportunity to make me look bad.

Actually no, I just made myself look bad. This works, but not when you're fullscreened because the focus movement is so minimal. Begin laughing at me please. However, I could still use some assistance if you see anything you think should be changed.

-whimper-

EDIT: however, it does seem to have a 2x2 level limitation on a gmap. Is there any way to extend this range, or is this an engine limitation?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #2  
Old 05-24-2007, 03:49 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
Well, that's because you're moving outside of the range of the loaded levels on a gmap. In gmap's, only the levels surrounding the player are loaded, and because you're just moving the camera focus and not the player, it doesn't load up any of the other levels.
You can overcome this by using a gmap option, though I don't remember it.
Reply With Quote
  #3  
Old 05-24-2007, 04:06 AM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
I'm only after a 5x5 level range, so it's not like I'm after loading 50+ levels at once or anything.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #4  
Old 05-24-2007, 04:14 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
You just have to tell the gmap to load all the levels at once.
Reply With Quote
  #5  
Old 05-24-2007, 01:46 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
Place this in your GMAP file (edit it with notepad):
LOADFULLMAP
__________________
Do it with a DON!
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 03:23 AM.


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