Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   V6 Function Requests (https://forums.graalonline.com/forums/showthread.php?t=134267283)

fowlplay4 10-22-2012 03:28 AM

V6 Function Requests
 
Just in case my post in the V6 Bug Thread doesn't get lost. If anyone has small function requests feel free to post them.

V6 Function/Event Requests:

PHP Code:

// This will do exactly what paused and 100ap does -- player doesn't block and swords do nothing. 
InvinciblePlayer(seconds); // Makes the player invincible for a set amount of time 
InvinciblePlayer2(); // Makes the player invincible until it uses... 
UnInvinciblePlayer();

player.dontblock();
player.blockagain(); 

Thread Explaining InvinciblePlayer:
Invincible Functions

A client-side event to detect when a flag (like attr[], client, clientr, serverr) is synced with the server-side value, so instead of doing:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}

function 
onTimeout() {
  if (
this.last != clientr.test) {
    
updateClientStuff();
    
this.last clientr.test;
  }
  
setTimer(0.05);


I could do:

PHP Code:

//#CLIENTSIDE
function onFlagSynced(flag) {
  if (
flag == "clientr.test") {
    
updateClientStuff();
  }



salesman 10-22-2012 06:43 AM

player.setShape(x, y, width, height) could be handy along with the blocking functions

cbk1994 10-22-2012 10:34 AM

Quote:

Originally Posted by salesman (Post 1706262)
player.setShape(x, y, width, height) could be handy along with the blocking functions

also player.setShapePoly(poly).

ffcmike 10-22-2012 10:34 PM

I'd really like to see some functions for the sake of being able to optimise custom systems, under the assumption that native code is much faster than GScript. If Graal is ever going to expand and try to attract a higher number of players, it's important to reduce the lag that can occur around a lot of players.

PHP Code:

getScreenPlayers(); //returns an array of all players visible on your screen
getAreaPlayers(xywh); //returns an array of all players within the specified box
getNicknameNPCs(); //returns an array of all NPCs which have a nickname and are visible
hideAllImages(); //hides all displays, instead of either hideimg(start, end); or multiple hideimg(index);
display.attachToObject(object); //makes a display automatically move along with the specified object, such as a player, similar to attachtoowner
2DBoxIntersect(box array 1box array 2); //returns whether 2 boxes touch edge-on or closer, {x, y, w, h}
2DBoxOverlaps(box array 1box array 2); //returns whether 2 boxes touch beyond their edge, {x, y, w, h}
2DBoxIntersectsPlayer(xywh); //returns if a box touches edge-on or closer with the player's own blocking area, , {x, y, w, h} + {player.x + 0.5, player.y + 1, 2, 2}
2DBoxOverlapsPlayer(xywh); //returns if a box touches beyond the edge of the player's own blocking area, , {x, y, w, h} + {player.x + 0.5, player.y + 1, 2, 2}
pixelRound(number); //rounds the number to the nearest pixel or 0.0625 


DustyPorViva 10-22-2012 11:16 PM

The ability to get an array of tiles in a box(equivalent to onwall2) without looping would be nice.

Like tilesBox(x,y,width,height) would return an array of all the tiles detected within the constraints.

Also tiletypeBox(x,y,width,height) which would do the same, but return tiletypes.

This is off the top of my head and there may be a more graceful function scheme, but all I know is when you start getting into customizing anything involving tile checks, you always have to loop and check tiles individually which is a pain and can be expensive at times.

smirt362 10-23-2012 02:13 AM

Masking functions

Crow 10-23-2012 08:47 AM

Quote:

Originally Posted by smirt362 (Post 1706302)
Masking functions

Ohh, yes please. TShowImg objects need support for masks. 1-bit masks would be nifty already, but if possible, I wouldn't mind more advanced ones either :p

fowlplay4 11-10-2012 11:06 PM

The isinvincible flag that was added doesn't protect the player from projectiles or explosions.

Tim_Rocks 11-11-2012 12:25 AM

Since we're doing requests, I'd like profiles to allow highlighting in the text field. That would be very helpful.


All times are GMT +2. The time now is 04:08 AM.

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