Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   General Graal Discussion (https://www.graalians.com/forums/forumdisplay.php?f=2)
-   -   Easy Map Script Fix (https://www.graalians.com/forums/showthread.php?t=714)

Winter 09-15-2011 11:08 PM

Easy Map Script Fix
 
On both iClassic and iEra, the map opens by pressing the map icon. To close the map, press close. On FaceBook on iClassic (and soon FaceBook iEra), you have shortcuts on the keyboard in addition to hitting the icon; you can open the map by pressing M. However, to get out of it you must manually click close.

When I look at the map on Unholy Nation, you press M to open the map, and M to close it again. This would make things much easier for many people, and I'm sure its a quick script that just needs to be added for convenience. Please?

Gunderak 04-27-2012 09:54 AM

*Bump*
Agreed, would be simple as anything to add..
PHP Code:

function onKeyPressed(codekey){
  if(
key == "m"){
    
//Close the map
  
}



Cigam 04-27-2012 12:28 PM

Quote:

Posted by Gunderak (Post 103187)
*Bump*
Agreed, would be simple as anything to add..
PHP Code:

function onKeyPressed(codekey){
  if(
key == "m"){
    
//Close the map
  
}



Yes I agree.

callimuc 04-27-2012 05:26 PM

Quote:

Posted by Gunderak (Post 103187)
*Bump*
Agreed, would be simple as anything to add..
PHP Code:

function onKeyPressed(codekey){
  if(
key == "m"){
    
//Close the map
  
}



Oh great close it everytime you want to open it. No checks no map! ezpz

Pauli 04-27-2012 08:33 PM

I'm not a pro and idk if this will work :P
PHP Code:

function onKeyPressed(codekey){
  if (
key == "m")
{
    
//Open the map
  
} else
{
   
//Close the map
  
}



callimuc 04-27-2012 11:01 PM

Quote:

Posted by P.i (Post 103346)
I'm not a pro and idk if this will work :P
PHP Code:

function onKeyPressed(codekey){
  if (
key == "m")
{
    
//Open the map
  
} else
{
   
//Close the map
  
}



Would close the map whenever you press any other key.


Maybe this could work. Itīs kinda late now and had a tough day but I gues this would work.
PHP Code:

function onKeyPressed(codekey) {
  if (
key != "m") return; //recently fell in love to use this way idk why
  
this.mapclosed = !this.mapclosed//change the boolean (true/false)
  
if (this.mapclosedstartARandomFunctionToOpenTheMapOrTheActualScript();
  else if (!
this.mapclosedcloseTheMap();



Gunderak 04-28-2012 01:46 PM

Pointless ^

callimuc 04-28-2012 02:11 PM

Quote:

Posted by Gunderak (Post 103695)
Pointless ^

Better than just closing the map without having it actually opened.

Gunderak 04-28-2012 02:15 PM

It was just an example because I was bored, it's not like they would of copied it on to their scripts.

callimuc 04-28-2012 02:17 PM

Mine was just an example aswell.

Ph8 04-28-2012 02:29 PM

function onKeyPressed(code, key) {
if (key == "m"){
player.chat = "Parrrtayyyyyyyyyy";
}
}

This is all.

Gunderak 04-28-2012 02:29 PM

[PHP ][/PHP ]
;)

iStorm 05-01-2012 03:44 PM

Nice..

MysticalDragon 05-01-2012 04:22 PM

You would actually have to use invoke_adventure keys.But anyways how is it easier to click on the chat icon, press m then select enter, the sound of it just sounds annoying. Its so much more simpler to just click on the map icon, But for Staff that m key IS ENABLED.

callimuc 05-01-2012 04:57 PM

Quote:

Posted by MysticalDragon (Post 107528)
You would actually have to use invoke_adventure keys.But anyways how is it easier to click on the chat icon, press m then select enter, the sound of it just sounds annoying. Its so much more simpler to just click on the map icon, But for Staff that m key IS ENABLED.

I gues shannon did mean it more for iClassic to close it with the M key again

Winter 05-01-2012 08:20 PM

Quote:

Posted by MysticalDragon (Post 107528)
You would actually have to use invoke_adventure keys.But anyways how is it easier to click on the chat icon, press m then select enter, the sound of it just sounds annoying. Its so much more simpler to just click on the map icon, But for Staff that m key IS ENABLED.

I'm sorry, I was not clear. See, here on iClassic, we have VIP accounts which let us play on a single account on multiple devices, including using a computer (meaning no "touching the icon"). I would hope that as an iEra developer you would have at least some knowledge of this by now, seeing as I understand the VIP system will also be used for iEra in the future.

So in a sense, your last statement is right. For staff, the M hotkey to open the map is enabled on both servers. However, once the Era Graalians are able to use their accounts on the computer, they will also come across this problem if it is not addressed now. While it is not a huge problem, it does become bothersome and I would like to see it improved. It would benefit both servers in the long run, and every little thing adds up!

0PiX0 05-01-2012 09:04 PM

we'll probably add it to era if it ever is accessible from a computer

MysticalDragon 05-01-2012 09:06 PM

Quote:

Posted by Shannon (Post 107654)
I'm sorry, I was not clear. See, here on iClassic, we have VIP accounts which let us play on a single account on multiple devices, including using a computer (meaning no "touching the icon"). I would hope that as an iEra developer you would have at least some knowledge of this by now, seeing as I understand the VIP system will also be used for iEra in the future.

So in a sense, your last statement is right. For staff, the M hotkey to open the map is enabled on both servers. However, once the Era Graalians are able to use their accounts on the computer, they will also come across this problem if it is not addressed now. While it is not a huge problem, it does become bothersome and I would like to see it improved. It would benefit both servers in the long run, and every little thing adds up!

Oh I wasn't aware of this, I don't play(Never played) iClassic and Iera doesn't have those features as of yet. But Pix would no more anyways.

Emera 05-01-2012 09:35 PM

Quote:

if (key != "m") return; //recently fell in love to use this way idk why
Genius. I'm using it >:) Best thing since switch and case.

Gunderak 05-10-2012 07:05 AM

How is this genius?
What happens if you wan't multiple key events?
It would simply return unless you invoke the first event.

Twinny 05-10-2012 11:13 AM

Quote:

Posted by Gunderak (Post 113471)
How is this genius?
What happens if you wan't multiple key events?
It would simply return unless you invoke the first event.

PHP Code:

if (!(key in {"k""i""e"})) return; 

For the map
PHP Code:

If (mapobj.visible
  
mapobj.visible false;
Else
  
mapobj.visible true

Basic example. The actual script would create an animation to bring it up/down

Skyzer 05-11-2012 06:00 AM

Quote:

Posted by Gunderak (Post 103726)
[PHP ][/PHP ]
;)

PHP Code:

derp 

[php]derp[/php]
[noparse][php]derp[/php][/noparse]

Gunderak 05-11-2012 11:37 AM

PHP Code:

if*(!(key*in*{"k",*"i",*"e"}))*return; 

But then when you press K I or E it would invoke the event..
And the animation is fairly simple.
PHP Code:

with(GUI.CreateAnimation()){
  
transition "fadein"//Whatever animation you want
  
time 1//The time it takes



callimuc 05-11-2012 02:38 PM

Quote:

Posted by Gunderak (Post 114014)
PHP Code:

if*(!(key*in*{"k",*"i",*"e"}))*return; 

But then when you press K I or E it would invoke the event..]

Because the event is supposed to get invoked as soon as these keys are pressed...
I think the iServers have pretty much every thing under control and do know how to reduce the lag as much as possible.

Winter 05-11-2012 07:06 PM

How about a script that causes the back button to be pressed when the M key is pressed with map open, so it closes the map without having to script the entire map closure again? I have no experience with scripts, but this seems like the most simple idea to me.

callimuc 05-11-2012 07:18 PM

Quote:

Posted by Shannon (Post 114160)
How about a script that causes the back button to be pressed when the M key is pressed with map open, so it closes the map without having to script the entire map closure again? I have no experience with scripts, but this seems like the most simple idea to me.

That could be done. Even though I got no clue what Gunderak is worrying about

Twinny 05-11-2012 11:34 PM

Quote:

Posted by Gunderak (Post 114014)
PHP Code:

if*(!(key*in*{"k",*"i",*"e"}))*return; 

But then when you press K I or E it would invoke the event..

Oh noes!!!

I'm sure that tiny lil delay isn't going to cost your script tooooooo much time. Its not like you have any other choice so why even bring that up?

Gunderak 05-12-2012 12:46 PM

Ugh you obviously don't see what I'm saying.
What happens if on the U key you want it to do one thing and M to do another?
The event would be invoked when you press any of the keys.

Twinny 05-12-2012 03:47 PM

Quote:

Posted by Gunderak (Post 114614)
Ugh you obviously don't see what I'm saying.
What happens if on the U key you want it to do one thing and M to do another?
The event would be invoked when you press any of the keys.


That line I wrote will simply finish that particular event block from continuing if the key pressed wasn't part of the three specified. You could further test after that if necessary.

If you want to run a script with different statements based on the key, you could just do it by a switch, if-else if or even in a seperate script catching the same event (the return line won't affect other functions catching that event after all).

I don't understand why you had to raise the point of multiple events at all when the suggested script clearly only cares about the 'm' key? I find ending the block if the key is not 'm' a very clean and effective method.

Winter 05-12-2012 04:40 PM

Quote:

Posted by Gunderak (Post 114614)
What happens if on the U key you want it to do one thing and M to do another?

Perhaps you don't fully understand the suggestion I and some other posters came up with. While the map is closed, M opens it. While the map is open, M will close it again. No U, I, K, or anything else. I'm no expert, but it sounds like Twinny has the right idea.


All times are GMT. The time now is 01:14 PM.

Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.