Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-21-2004, 12:04 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!

Last edited by falco10291029; 08-21-2004 at 02:54 AM..
Reply With Quote
  #2  
Old 08-21-2004, 12:13 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
I don't mean to annoy you, but you might want to format your script a little better than that.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #3  
Old 08-21-2004, 12:33 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
is it all clientsided?
Reply With Quote
  #4  
Old 08-21-2004, 02:52 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #5  
Old 08-21-2004, 04:41 AM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
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.
Reply With Quote
  #6  
Old 08-21-2004, 05:37 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
Reply With Quote
  #7  
Old 08-21-2004, 11:33 AM
nullify nullify is offline
Registerd Abuser
nullify's Avatar
Join Date: May 2004
Location: The cheese state.
Posts: 851
nullify has a spectacular aura about
I always add all of my projectiles into my system, no need to flood people with NPC's when they can be combined.
Reply With Quote
  #8  
Old 08-21-2004, 04:32 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #9  
Old 08-21-2004, 11:18 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
Reply With Quote
  #10  
Old 08-22-2004, 12:47 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ZeroTrack
something like that =p
Indeed.
Reply With Quote
  #11  
Old 08-22-2004, 04:03 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #12  
Old 08-22-2004, 04:41 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
Reply With Quote
  #13  
Old 08-22-2004, 05:26 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #14  
Old 08-22-2004, 05:33 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
}
}
Reply With Quote
  #15  
Old 08-23-2004, 12:48 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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;
}
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #16  
Old 08-23-2004, 01:05 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
like i said, theres nothing wrong with your class, it has to be in the weapons
Reply With Quote
  #17  
Old 08-23-2004, 01:09 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
well i dont think that there is anything wrong with the weapons either.....
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #18  
Old 08-23-2004, 03:18 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
Reply With Quote
  #19  
Old 08-23-2004, 08:16 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I checked every weapon and every wepon works fine agenst players and shoot and no weps work agenst the molds
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #20  
Old 08-23-2004, 09:03 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
  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?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #21  
Old 08-23-2004, 11:19 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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?
Reply With Quote
  #22  
Old 08-23-2004, 11:38 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
hmm i will try removing the showcharacter and adding a setshape or something....
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #23  
Old 08-24-2004, 07:09 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
he has it in serverside lance =D (this post is getting annoying lol)
Reply With Quote
  #24  
Old 08-24-2004, 07:17 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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
Reply With Quote
  #25  
Old 08-24-2004, 03:24 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
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.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #26  
Old 08-24-2004, 03:24 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Well mold basically works now i basically still have a few things i might fix like giving it a death animation or something...
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
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 11:34 AM.


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