Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Mold from EK (https://forums.graalonline.com/forums/showthread.php?t=54994)

falco10291029 08-21-2004 12:04 AM

Mold from EK
 
Ok i'm sorry i have been trying to avoid posting here because i have the feeling i am becoming annoying, but no one i talk to can figure this out!


NPC Code:
 

if (created) {
initialize();
}
if (timeout) {
message #v(this.hearts/2);
if (this.found==0) {
setcharani mold_idle,;
for (i=0;i<playerscount;i++) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {

this.found=1;
break;
}
}
}

if (this.found==1) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {
setcharani ekmold-move,;
tx=players[i].x - x;
ty=players[i].y - y;
dist= (tx*tx+ty*ty)^0.5;
nx= (tx/dist)*1.2;
ny= (ty/dist)*1.2;
move nx,ny,1.2,;

if (players[i].x in |x-3,x+3|&&players[i].y in |y-3,y+3|) {
setcharani ekmold-attack,;
with(players[i]) {
setani hurt,;
setstring client.hp,#v(strtofloat(#s(client.hp))-1);
};
timeout=1;
}
} else {
setcharani ekmold-idle,;
this.found=0;
timeout=.1
}


timeout=.4;
}
timeout=.4;
}


function initialize() {

this.hearts=6;
setcharani ekmold-idle,;
timeout=.4;
}

function checkdead() {

if (this.hearts<=0) {
with(getplayer(#p(2))) {
insertstring client.messages,0,You gained EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
if (strlen(#g)>1) {
setstring server.account,#a;
setstring server.guild,#g
}
}
for(i=0;i<allplayerscount;i++) {
with (allplayers[i]) {
if (strequals(#g,#s(server.guild))&&!strequals(#a,#s( server.account))) {
insertstring client.messages,0,You guild/party got you EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
}

}

}


timeout=0;
putexplosion 1,x,y;
hide;
sleep 30;
show;
initialize();

}


else {
setcharani mold_idle,;
timeout=.65
}


}

//PROBLEM AREA
if (actionprojectile) {
this.hearts-=strtofloat(#p(1))+1;
setcharani mold_idle,;
message #v(this.hearts/2);
checkdead();
sleep .5;
}
//








ok i have looked over it as have several NATs. See the if (actionprojectile)?
well it doesnt respond to that. it ignores it. Acts like i never added that flag. It is very weird. I have actually replaced it with simple things like playerchats and they work. So why doesnt this? It should work by all standards. It used to work before EK was hacked. but now it doesnt. Any help would be appreciated

DarkShadows_Legend 08-21-2004 12:13 AM

I don't mean to annoy you, but you might want to format your script a little better than that.

ZeroTrack 08-21-2004 12:33 AM

is it all clientsided?

falco10291029 08-21-2004 02:52 AM

no it's actually a class all the npc join into it. and ill edit my script and format it a bit if it really bugs u XD

Xecutor 08-21-2004 04:41 AM

Quote:

Originally Posted by falco10291029
no it's actually a class all the npc join into it. and ill edit my script and format it a bit if it really bugs u XD

Not formatting your code properly and using code tags has no purpose.

Also, I thought that only weapon scripts could recognize actionprojectile events. Check out your newfeatures documents.

ZeroTrack 08-21-2004 05:37 AM

Quote:

Originally Posted by falco10291029
no it's actually a class all the npc join into it. and ill edit my script and format it a bit if it really bugs u XD

LoL noooo

Quote:

Originally Posted by Xecutor
Not formatting your code properly and using code tags has no purpose.

Also, I thought that only weapon scripts could recognize actionprojectile events. Check out your newfeatures documents.

And this is ture, make a weapon called -Projections or something and make the class trigger the action to that weapon, this way you can put all your actionprojectiles in that weapon just use #p(0) it identify each diffrent projection
^^

nullify 08-21-2004 11:33 AM

I always add all of my projectiles into my system, no need to flood people with NPC's when they can be combined.

falco10291029 08-21-2004 04:32 PM

wait how can i make it read projectiles for a monster? Also Like i said it used to work fine, i dont know why it doesnt anymore.

ZeroTrack 08-21-2004 11:18 PM

Quote:

Originally Posted by falco10291029
wait how can i make it read projectiles for a monster?

just put the action in the monster like u would the weapon , so say if your using a gun and you sent the identifying pram as "gun" it would sorta look like
NPC Code:

if(actionprojectile){
if(strequals(#p(0),gun)){
this.hearts-=.5;
}
}



something like that =p

Lance 08-22-2004 12:47 AM

Quote:

Originally Posted by ZeroTrack
something like that =p

Indeed. :)

falco10291029 08-22-2004 04:03 AM

thats how it is well actually i used #p(1) because all of the weapons have damage after the parameter some just stun players for a while i figured a mold wouldnt be able to get stunned bnut anyways as you can see i did that but it doesnt work thats the problem as i sed

ZeroTrack 08-22-2004 04:41 AM

Quote:

Originally Posted by falco10291029
thats how it is well actually i used #p(1) because all of the weapons have damage after the parameter some just stun players for a while i figured a mold wouldnt be able to get stunned bnut anyways as you can see i did that but it doesnt work thats the problem as i sed

... ok im deff having a hard time understand what in gods name u did haha but if you want you can contact me on AIM and we'll talk further that way we dont have to keep this thread open anymore either

Aim = Sern18

falco10291029 08-22-2004 05:26 AM

well he is trying to fix so far no luck but we have these deductions:

1.the problem is most likely with actionprojectile, since most other flags work.
2. I have no others this is tough :(

ZeroTrack 08-22-2004 05:33 AM

Quote:

Originally Posted by falco10291029
well he is trying to fix so far no luck but we have these deductions:

1.the problem is most likely with actionprojectile, since most other flags work.
2. I have no others this is tough :(

i only have the read rights for the mold class but look

Make sure that you set shootprams

EX:
this.maxangle = .05;
setshootparams gun,#g,#a,#v(this.damage),gun;
this.x = playerx+vecx(playerdir)*2;
this.y = playery-.3+vecy(playerdir)*2;
this.angle = getangle(vecx(playerdir),vecy(playerdir));
shoot this.x,this.y,playerz,this.angle+random(this.maxan gle*-1,this.maxangle),.75,this.power2,bullet,;


then in the class
if(actionprojectile){
if(strequals(#p(6),grenade)){
damage stuff our whatever else u want
}
}

falco10291029 08-23-2004 12:48 AM

well most of our weapons look like this for the shoot part:

setshootparams sword1(or a diff one if it does something special),damage,#a;
this.angle=getangle(vecx(playerdir),vecy(playerdir ));
this.x=playerx+vecx(playerdir);
this.y=playery+vecy(playerdir);
shoot this.x,this.y,playerz,this.angle(+random depending on the weapon),0,0,gani,;
//I use those zeroes just as an example.


then as u all saw in the mold:

if(actionprojectile){

this.hearts-=strtofloat(#p(1))+1;//i dont use the first parameter on the mold because so far nothing that would do a special thing like confusion or steal would affect mold
setcharani mold_idle,;
message #v(this.hearts/2);
checkdead();
sleep .5;
}

ZeroTrack 08-23-2004 01:05 AM

like i said, theres nothing wrong with your class, it has to be in the weapons

falco10291029 08-23-2004 01:09 AM

well i dont think that there is anything wrong with the weapons either.....

ZeroTrack 08-23-2004 03:18 PM

i have a good feeling it is, check the x and y cords and make sure there triggering in the right positions, make sure your prams are before the shoot action just to make sure cause im willing to bet any amount of money its the action

falco10291029 08-23-2004 08:16 PM

I checked every weapon and every wepon works fine agenst players and shoot and no weps work agenst the molds

Dach 08-23-2004 09:03 PM

  1. projectiles don't seem to be able to "see" showcharacter npcs
  2. showcharacter npcs don't seem to recieve the actionprojectile event
*results derived from testing on the Adiarde server
**also, testing was done on dbnpcs and classes, level npc's were not tested
***the projectiles worked on non-showcharacter classes
****why is it so much fun to post like this?

Lance 08-23-2004 11:19 PM

Quote:

Originally Posted by Dach
  1. projectiles don't seem to be able to "see" showcharacter npcs
  2. showcharacter npcs don't seem to recieve the actionprojectile event

Clientside, serverside, what?

falco10291029 08-23-2004 11:38 PM

hmm i will try removing the showcharacter and adding a setshape or something....

ZeroTrack 08-24-2004 07:09 AM

he has it in serverside lance =D (this post is getting annoying lol)

Lance 08-24-2004 07:17 AM

Quote:

Originally Posted by ZeroTrack
he has it in serverside lance =D (this post is getting annoying lol)

I was referring to Chad's tests

Dach 08-24-2004 03:24 PM

Quote:

Originally Posted by Lance
Clientside, serverside, what?

oh yeah, clientside, didn't check server... *checks now*

serverside it works alright, save for the lag induced problems.

falco10291029 08-24-2004 03:24 PM

Well mold basically works now i basically still have a few things i might fix like giving it a death animation or something...


All times are GMT +2. The time now is 08:22 PM.

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