Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-02-2009, 02:04 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
triggeraction vs player.trigger

Here's the thing - I really, really hate the triggeraction(targetx+1.5,targety+1.5,hit,2); technique. What happens if the target's lagging? What happens if he moves between the point that you had him lined up in your sites and took the shot and the point that the action triggers on his spot?

And yet I find myself with a script that's almost finished - except that the previous scripter used triggeraction. I've got a whole beautiful (not elegant, I don't do elegant) subroutine for detecting which players are about to get hit and storing their names, and I've got a whole beautiful loop for picking each one and hitting them...but because I'm not writing (guessing) it Exactly Right, it doesn't do a damn thing.

Here's what I got:

PHP Code:
//#CLIENTSIDE

function onActionMelee() {
  
player.chat=("Hit! "@params[0SPC params[1]);
  
setAni("hurt""");
  if(
this.cooldown<1){
    
triggerserver("gui"this.name"hurt"params[0], params[1]);
    
findWeapon("GUIInventory").trigger("showHUD""");
    
this.cooldown=60;
  }

which works fine (but only for triggeraction x y), and
PHP Code:
          with(findplayer(plr)){
            
//            echo("Found "@plr SPC ani);
            
setAni("hurt""");
            
triggerserver("gui""#HP""hurt""other"temp.dmg);
            
this.findWeapon("#HP").trigger("Melee""other""3");
            
this.findWeapon("#HP").trigger("ActionMelee""other""3");
            
this.findWeapon("#HP").trigger("OnActionMelee""other""3");
            
this.findWeapon("#HP").melee("other""3");
            
this.findWeapon("#HP").Melee("other""3");
            
this.findWeapon("#HP").ActionMelee("other""3");
            
this.findWeapon("#HP").actionmelee("other""3");
            
this.findWeapon("#HP").onactionmelee("other""3");
            
this.findWeapon("#HP").OnActionMelee("other""3");
          } 
(also clientside); to reiterate, isn't there some sort of player.trigger(wossname)?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
 


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 01:19 PM.


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