View Single Post
  #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