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 01-13-2006, 07:36 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
event metouchsplayer (backwards playertouchsme)

Having an event handler for objects touching players would make serverside damage handling infinitely better (esp. for baddies).
Reply With Quote
  #2  
Old 01-13-2006, 09:12 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Or Stefan enabling the onCollision() function on 2D playerworlds would be great. =D
__________________
Liek omigosh.

Reply With Quote
  #3  
Old 01-13-2006, 09:18 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Ajira
Or Stefan enabling the onCollision() function on 2D playerworlds would be great. =D
yea
Reply With Quote
  #4  
Old 02-19-2006, 08:00 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
okay, I SERIOUSLY SERIOUSLY want an event for when the NPC comes into contact on the sole behalf of it's own movement after instantiation. I want this VERY VERY much.
Reply With Quote
  #5  
Old 02-20-2006, 05:34 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
okay, I SERIOUSLY SERIOUSLY want an event for when the NPC comes into contact on the sole behalf of it's own movement after instantiation. I want this VERY VERY much.
Then script it.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 02-20-2006, 06:33 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
Then script it.
....
Okay, don't be an idiot, PLEASE.
So, given: an NPC joined to a baddy class, and serverside HD.
In order to do anything with as little lag as possible, you'd want to test for NPCs clientside on a 1/20 timeout, trigger the server in a weapon, which in turn triggers the event in the NPC. This would probably cause a substantial amount of lag (not to mention I'd get yelled at for it being insecure). If there were a direct method built into gscript, it would be much more efficient (hardcoding, easier access to classes).

Last edited by jake13jake; 02-20-2006 at 06:46 AM..
Reply With Quote
  #7  
Old 02-20-2006, 06:17 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Um, I'm not sure I understand exactly where you're getting at, but NPC's do act upon collision with the player with an if (playertouchsme) {}. I've noticed that if you create an NPC and set it to move from point A to point B, and the player is standing somewhere inbetween the path, idle, then when the NPC goes through the player, the system reads it as if the player is touching the NPC, even though the player did not move at all.
Reply With Quote
  #8  
Old 02-20-2006, 06:28 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Yeah. On the serverside, playertouchsme is triggered when the NPC moves to the player. And on the clientside, there is not that much of a problem with a 0.05 timeout loop with collision checking
Reply With Quote
  #9  
Old 02-20-2006, 07:26 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
But onCollision() would be awesome for both clientside and serverside.
__________________
Liek omigosh.

Reply With Quote
  #10  
Old 02-20-2006, 07:57 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
....
Okay, don't be an idiot, PLEASE.
So making countless useless suggestions that are easy enough to script isn't being an idiot?

Quote:
Originally Posted by jake13jake
So, given: an NPC joined to a baddy class, and serverside HD.
In order to do anything with as little lag as possible, you'd want to test for NPCs clientside on a 1/20 timeout, trigger the server in a weapon, which in turn triggers the event in the NPC. This would probably cause a substantial amount of lag (not to mention I'd get yelled at for it being insecure). If there were a direct method built into gscript, it would be much more efficient (hardcoding, easier access to classes).
If you're scriptin the movement for the NPC, it would not be hard at all to detect if it hit a player during it's movement.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #11  
Old 02-20-2006, 08:05 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
If you're scriptin the movement for the NPC, it would not be hard at all to detect if it hit a player during it's movement.
...using the move function?
Really, the only way to do it would be with a timeout. ie. go to Kingdoms and tell me if the bomies there can attack you just as efficiently as the baddies in offline mode.

Might add, I try not to suggest useless things. I try to suggest things that would either make sense to have built in. I generally don't have a problem creating complex things as long as I have all the tools to do it. The read-only var for npcs blocking is an example of that, and now my movement is done, and all of Classic's systems are ready for v2 disabling except for AP, Ratings, and a new rank system

Quote:
Originally Posted by Loriel
Yeah. On the serverside, playertouchsme is triggered when the NPC moves to the player. And on the clientside, there is not that much of a problem with a 0.05 timeout loop with collision checking
Thanks. It didn't before, but maybe I should test to see if it does now.

Last edited by jake13jake; 02-20-2006 at 10:22 PM..
Reply With Quote
  #12  
Old 02-23-2006, 01:19 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by jake13jake
Thanks. It didn't before, but maybe I should test to see if it does now.
PHP Code:
NPC *****.png 21 38
function onCreated() {
  
setshape(1,64,64);
  while(
true) {
    
move(20,0,10,0);
    
sleep 10;
    
move(-20,0,10,0);
    
sleep 10;
  }
}
function 
onPlayerTouchsMe() {
  
player.chat "giggle";
}
NPCEND 
Uhm, Loriel... I didn't move, and playertouchsme wasn't called. But what you said is exactly what I would want... an abstraction of the problem of creating a more aesthetic damage system.
Reply With Quote
  #13  
Old 02-23-2006, 01:25 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by jake13jake
Uhm, Loriel... I didn't move, and playertouchsme wasn't called.
I guess someone broke it
Sorry about that; but I distinctly remember playertouchsme on serverside acting different than on clientside. Good thing this thread is not in the scripting forum so I get away with bad advice :D

Last edited by Loriel; 02-23-2006 at 01:43 AM..
Reply With Quote
  #14  
Old 02-23-2006, 01:28 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Loriel
I guess someone broke it
Sorry about that; but I distinctly remember playertouchsme on serverside acting different than on clientside.
I remember about it only getting called on initial contact on serverside, and it getting called (but not anymore) when every .05 seconds movement is true on clientside. I could be wrong, that would be my guess though.
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 04:33 AM.


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