Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-07-2008, 10:00 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Level-Style Triggeractions

This is for a mining system. I have a trigger going from the pickaxe weapon to the clientside portion of the rock called 'MineHit'. That trigger is received perfectly fine. The problem is that I obviously need to access the Serverside portion of the rock NPC.
I triggered onActionServerside, but for some reason it's finding it on the Clientside instead of on the Serverside. None of the triggers I send are being found anywhere but the Clientside, no matter how I tweak them.

NPC Code:
function onActionServerside() {
switch ( params[0] ) {

case "Damage Rock":
this.chat = "Hit by.."@ params[1];
break;

}
}
//#CLIENTSIDE
function onCreated() {
setShape(1,32,32);
setImg("np_miningrocks_2.png");
DrawUnderPlayer();
}
function onActionMineHit() {
temp.owner = params[0];
temp.pwr = params[1];
triggeraction(x+1.5,y+1.5,"Serverside","Damage Rock",temp.owner); // Triggers the clientside -.-
if ( temp.pwr > 0 ) ShowDamage( temp.pwr );
}
function onActionServerside() {
this.chat = "Called on the Clientside.";
}
function ShowDamage( damage ) {
this.newx = this.x + random(.4,1.1);
this.newy = this.y - .5;
this.newalpha = .99;
temp.subx = random(.05,.135);
temp.suby = random(.12,.22);
for ( i=0;i<25;i++ ) {
this.newx += temp.subx;
this.newy -= temp.suby;
this.newalpha -= .05;
showText(350,this.newx,this.newy,"Arial Narrow","bold",damage);
changeImgColors(350,.8,0,0,this.newalpha);
changeImgVis(350,1);
sleep(.05);
if ( this.newy < this.y - 3 ) {
hideImg(350);
break;
}
}
}



When the rock is hit with the pickaxe, everything works, but instead of getting the intended return 'Hit by..The_Kez' it returns 'Called on the Clientside.'

Last edited by The_Kez; 01-07-2008 at 10:04 AM.. Reason: Typo
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 10:53 PM.


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