Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-10-2012, 07:40 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Triggeractions and x and y axis.

I've come across a small and tedious difficulty, and now I know why some of my projects had to be redone.

Problems:
1. Need better tutorials for triggeraction, I keep setting shape to clientside because I kept believing it needed a shape to react from, not to.
(Not really a problem, only a difficulty in remembering and understanding)

2. I was told setshape was a replacement for showcharacter or vise versa except one was the default npc character look.
Solution: Make show character work?

3. If an X or Y is set at an offset by less than .5 it breaks the trigger.
Ex. 32.4 wouldn't work. 32.5 would work, 32.6 wouldn't work.
Solution, fix it to make work ...?

4. If any X and Y placement is done clientside, it renders serverside void...
Solution ...not sure. But it seems like anything my clientside has done via X and Y, it would have to trigger the final points serverside which seems stupid.

__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #2  
Old 06-10-2012, 08:22 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Graal sends positional data as a byte for triggeractions. One byte is a value between 0-255.

Graal packs the positional data into a single byte per axis, so you have limited accuracy. 20.4 is rounded down to 20, and 20.6 is rounded up to 21. Both of those are outside of the non-inclusive 32x32 range that Graal seems to be testing against.
Reply With Quote
  #3  
Old 06-11-2012, 01:43 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
So there is no way to fix this besides making them position in tiles?
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #4  
Old 06-19-2012, 02:57 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I don't exactly understand what the problem is.
showcharacter() makes the npc have a blocking behaviour like the a player, which means a rectangle of (0.5,1,2,2) (starts at x+0.5, y+1 and is 2x2 tiles wide)
triggeraction() is rounding the x and y values down to the next multiply of 0.5, which means 0.6 will become 0.5, 1.4 will become 1.
Reply With Quote
  #5  
Old 06-19-2012, 03:13 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Quote:
Originally Posted by Stefan View Post
I don't exactly understand what the problem is.
showcharacter() makes the npc have a blocking behaviour like the a player, which means a rectangle of (0.5,1,2,2) (starts at x+0.5, y+1 and is 2x2 tiles wide)
triggeraction() is rounding the x and y values down to the next multiply of 0.5, which means 0.6 will become 0.5, 1.4 will become 1.
His problem is that the client and server have different positions. He moves the NPC clientside and because of that the trigger can no longer be sent from the server to the client. The only solution I can think of for this is either placing an NPC at the origin of the NPC's spawn in the onCreated event which would relay the triggeraction to the appropriate NPC, or creating a whole NPC ID'ing system would would make it position-independent.
Reply With Quote
  #6  
Old 06-20-2012, 04:37 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by Hezzy002 View Post
His problem is that the client and server have different positions. He moves the NPC clientside and because of that the trigger can no longer be sent from the server to the client. The only solution I can think of for this is either placing an NPC at the origin of the NPC's spawn in the onCreated event which would relay the triggeraction to the appropriate NPC, or creating a whole NPC ID'ing system would would make it position-independent.
Serverside does not work also, if they aren't of .5's, however I have not tried to edit the origin to be less than or greater than .5's yet, so I'll try that when I have time, on testbed.

PHP Code:
NPC block.png 33.2 35.7
function onCreated(){
  
this.33.2;
  
this.35.7;
  
setshape(1,32,32);
}
function 
onActionServerside(){
  
this.chat "test";
}
//#CLIENTSIDE
function onCreated(){
  
this.33.2;
  
this.35.7;
  
triggeraction(this.x,this.y,"Serverside",null);
}
NPCEND 
Not sure how to do the whole NPC system.
My fix was just to bring it back to .5 lol..
Unless someone else wants to try ^, I will try it in a week or so.
(I'm not sure if I set both to it either)

Thank you for the reply, I'll see if it works and test when I can.

Quote:
Originally Posted by Stefan View Post
I don't exactly understand what the problem is.
showcharacter() makes the npc have a blocking behaviour like the a player, which means a rectangle of (0.5,1,2,2) (starts at x+0.5, y+1 and is 2x2 tiles wide)
triggeraction() is rounding the x and y values down to the next multiply of 0.5, which means 0.6 will become 0.5, 1.4 will become 1.
As for showcharacter(); I was only thinking that is could be worked on to be used with triggeraction.
If it works, which from the post I'm unsure, than that is great. I only tried it once, but maybe not correctly.
This type of fix is not important... at all.. but could be useful if you want to showcharacter instead of setshape.
(Yes, I understand there is no real difference, but I thought it was awkward setting shape of a character).

Basically the problem was:
this.x = 32.3;
this.y = 32.3;
under serverside or (clientside which didn't matter for triggers), it would not work due to it not being of multiples of .5;
But like Hezzy mentioned, I've never tried the exact location by editing as text. I'll try that next.

Showcharacter I just thought could be added to work like setshape for triggeraction, which isn't a problem.

Thank you as well.


The video I had already set up the triggeraction to work, I was only showing what did not work... clientside, serverside less than or greater than .5. I've never seen it mentioned in tutorials.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz




Last edited by Devil_Lord2; 06-20-2012 at 04:54 AM..
Reply With Quote
  #7  
Old 06-20-2012, 05:05 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
When I read your posts I get the feeling you have no idea what you're talking about.
Reply With Quote
  #8  
Old 06-22-2012, 04:58 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by Hezzy002 View Post
When I read your posts I get the feeling you have no idea what you're talking about.
I don't.
Clientside - Doesn't work for serverside.
Serverside - Doesn't work for anything not of .5's
NPC Index - Doesn't work for anything not of .5's
That is what I know.

If it doesn't work, I assume there is a problem somewhere.
Not sure how Graal was built, so I can't say I know what I'm talking about.

Anyway, you guys are more than welcome to test it yourselves.

Test 1 (Assumed it might work since on Clientside it was only one tile off. Meaning part of it was still one tile on for Serverside, and on the top-left corner half) Does not work.
(This test was not tested last time)
PHP Code:
NPC block.png 28 32
function onActionServerside(cmd){
  
findPlayer(cmd).chat "This Works.";
}
function 
onCreated(){
  
setshape(1,32,32);
}
//#CLIENTSIDE
function onCreated(){
  
this.x-=1;
}
function 
onPlayerTouchsMe(){
  
triggeraction(this.x,this.y,"Serverside",player.account);
}
NPCEND 
Test 2 Regular Triggeraction - Works.
PHP Code:
NPC block.png 32 32
function onActionServerside(cmd){
  
findPlayer(cmd).chat "This Works.";
}
function 
onCreated(){
  
setshape(1,32,32);
}
//#CLIENTSIDE
function onPlayerTouchsMe(){
  
triggeraction(this.x,this.y,"Serverside",player.account);
}
NPCEND 
Test 3 Triggeraction with an added .5 on X Serverside - Works.
PHP Code:
NPC block.png 36 32
function onActionServerside(cmd){
  
findPlayer(cmd).chat "This Works.";
}
function 
onCreated(){
  
setshape(1,32,32);
  
this.+= .5;
}
//#CLIENTSIDE
function onPlayerTouchsMe(){
  
triggeraction(this.x,this.y,"Serverside",player.account);
}
NPCEND 
Test 4 Triggeraction with an added .3 on the Serverside - Does not work.
PHP Code:
NPC block.png 40 32
function onActionServerside(cmd){
  
findPlayer(cmd).chat "This Works.";
}
function 
onCreated(){
  
setshape(1,32,32);
  
this.+= .3;
}
//#CLIENTSIDE
function onPlayerTouchsMe(){
  
triggeraction(this.x,this.y,"Serverside",player.account);
}
NPCEND 
Test 5 Triggeraction with an added .3 on the NPC - Does not work.
(This test was not tested last time)
PHP Code:
NPC block.png 44.3 32
function onActionServerside(cmd){
  
findPlayer(cmd).chat "This Works.";
}
function 
onCreated(){
  
setshape(1,32,32);
}
//#CLIENTSIDE
function onPlayerTouchsMe(){
  
triggeraction(this.x,this.y,"Serverside",player.account);
}
NPCEND 
Slightly over two minute video.


Making it an NPC with its own ID is not part of the problem so it was not a test I was going to do. Not sure if NPC Characters that have interactions Clientside to Serverside should all be NPCs lol...

The only reason I came up with this is because my NPC randomly stopped working when I had her look like she was sitting correctly, -.3 tiles on the Y axis. The first time I started over, and on the second time I realized what was causing it.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #9  
Old 06-22-2012, 11:25 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Stop wasting your time, holy ****. What the Hell are you trying to accomplish? Stefan and I have both pointed out why your **** isn't working and the necessary solutions.
Reply With Quote
  #10  
Old 06-30-2012, 06:55 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Stefan mentioned Showcharacter having a blocking behavior. This has nothing to do with improving in the future making it usable to trigger action. He also mentioned triggeraction rounds to the nearest multiple of .5. That was not a solution, nor an explanation of how it can be fixed, except to make things directly .5 which I've already been doing.

You told me to place the NPC at the origin of the NPC's spawn. Tried that by making the spawn less than a multiple of .5. (Both the actual NPC position, and under onCreated) Did not work.

Creating a whole NPC IDing system does seems like a waste of time and unneeded for everyone to do should they want a moving character that reacts serverside.

I've only asked for a future improvement that NPCs can use triggeraction outside of multiples of five. You may believe those solutions were necessary, and work, and I may think the area can still be improved. Lets agree to disagree with each other and I'll keep this open.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #11  
Old 06-30-2012, 07:12 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Not sure what you're trying to accomplish, but typically triggering at a specific x/y is a bad idea and prone to error for many reasons (depends on what you're trying to do, though). I can't think of a time I've had to do that in years.
__________________
Reply With Quote
  #12  
Old 07-07-2012, 07:37 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Not sure what you're trying to accomplish, but typically triggering at a specific x/y is a bad idea and prone to error for many reasons (depends on what you're trying to do, though). I can't think of a time I've had to do that in years.
Isn't that how most typical minning systems, custom sword/punch systems work? By triggering at an x/y?

I believe he is saying that graal is using the cord's from where the NPC was placed, not the x/y value after the adjustment. For example when setting a npc in a spot that needs adjusted .5 to look proper. Then the tigger is basing off the cords before you hit the play button not the updated cords.? I might be wrong understanding him tho..
Reply With Quote
  #13  
Old 07-07-2012, 10:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
Isn't that how most typical minning systems, custom sword/punch systems work? By triggering at an x/y?
Some primitive systems do this, but it's not the recommended way (gives you less flexibility for things like attack radius and hitboxes). For mining it would be acceptable, although I'd probably not do it that way anyway.

Keep in mind those are essentially different use cases; Devil wants to send a message serverside to a known NPC, whereas a pickaxe wants to hit any rocks that might be at a certain (x, y).
__________________
Reply With Quote
  #14  
Old 07-07-2012, 10:54 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by scriptless View Post
Isn't that how most typical minning systems, custom sword/punch systems work? By triggering at an x/y?

I believe he is saying that graal is using the cord's from where the NPC was placed, not the x/y value after the adjustment. For example when setting a npc in a spot that needs adjusted .5 to look proper. Then the tigger is basing off the cords before you hit the play button not the updated cords.? I might be wrong understanding him tho..
I'd rather check for NCPs/players in a small area and treat those objects accordingly than use triggers for most things.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
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 10:58 PM.


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