Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Elemental NPC Weapons (https://forums.graalonline.com/forums/showthread.php?t=23202)

Spectre1337 02-07-2002 02:44 AM

Elemental NPC Weapons
 
Hi, I was wondering how I would make some neat NPC weapons that arent just some stupid putexplosions but better.. I am trying to make like Summon NPCs.. There would be one called 'Fire' and one called 'Fire 2', the 'Fire' npc would put a little bit of fire and use 10 MP and the 'Fire 2' NPC would use 15 and cause more damage.. And there would be the big NPCs that would use 50 MP, like on Final Fantasy games how the summons use a butt-load of MP and the little ones use low ammounts.. Who thinks they can help me with this? I can make the images if needed..


Quote:

For scripting help you can ask people on the
npc scripting forums, like Kaimetsu

GregoryYoshi 02-07-2002 02:49 AM

Re: Elemental NPC Weapons
 
Quote:

Originally posted by Spectre1337
Hi, I was wondering how I would make some neat NPC weapons that arent just some stupid putexplosions but better.. I am trying to make like Summon NPCs.. There would be one called 'Fire' and one called 'Fire 2', the 'Fire' npc would put a little bit of fire and use 10 MP and the 'Fire 2' NPC would use 15 and cause more damage.. And there would be the big NPCs that would use 50 MP, like on Final Fantasy games how the summons use a butt-load of MP and the little ones use low ammounts.. Who thinks they can help me with this? I can make the images if needed..



If you know how to work with vecx and vecy you can make just about anything :)

I have 4 basic level Magic NPCs...Fireshot, IceBlast, Quake, and Aero Blast.

They are all line attacks (ie go in a straight line until collision) so you have to aim well. Hehe, Quake actually causes the screen to jitter when it hits something :D They all do damage through triggeraction so something like Fireshot will slowly burn the player for a short amount of time :)

Spectre1337 02-07-2002 02:58 AM

Re: Re: Elemental NPC Weapons
 
Quote:

Originally posted by GregoryYoshi


If you know how to work with vecx and vecy you can make just about anything :)

I have 4 basic level Magic NPCs...Fireshot, IceBlast, Quake, and Aero Blast.

They are all line attacks (ie go in a straight line until collision) so you have to aim well. Hehe, Quake actually causes the screen to jitter when it hits something :D They all do damage through triggeraction so something like Fireshot will slowly burn the player for a short amount of time :)

Cool, I was thinking I would try to make a Fire, Ice, Earth, Lighting, and Shadow npcs.. The neat thing about the Shadow NPC I am working on is that it hits the player with an image (shadoworb.gif or something) and once it hits them, it turns their backpal to dusk8.png and works its way back to normal ever 10 seconds :) I was thinking they would go in a straight line too, so we are on the same idea here.

joseyisleet 02-07-2002 03:09 AM

-=Josey=-
The only way that you would be able to "do" your shadow NPC would be to use a server flag. Something like

if (weaponfired){
youcodehere;
}
if (yourhitplayerthinghere){
addstring server.hitbyshadow,#a;
}
Then with another NPC you'd have to check to see if the string contains their account name then set the backpal. In my opinion, backpals are pretty stupid. I'd use something like
seteffect 0,0,0,0.7;. The default is 0,0,0,0;.

TDO2000 02-07-2002 03:13 AM

Quote:

Originally posted by joseyisleet
-=Josey=-
The only way that you would be able to "do" your shadow NPC would be to use a server flag. Something like

if (weaponfired){
youcodehere;
}
if (yourhitplayerthinghere){
addstring server.hitbyshadow,#a;
}
Then with another NPC you'd have to check to see if the string contains their account name then set the backpal. In my opinion, backpals are pretty stupid. I'd use something like
seteffect 0,0,0,0.7;. The default is 0,0,0,0;.

um no, he could (even on non P2p) use triggeractions (ok other player needs a weapon that does shadow thing, but it's needed with a serverflag too)...

joseyisleet 02-07-2002 03:15 AM

Yeah, but, if they log off then back on it'll keep as the backpal. ;\

TDO2000 02-07-2002 03:18 AM

Quote:

Originally posted by joseyisleet
Yeah, but, if they log off then back on it'll keep as the backpal. ;\
the NPC getting triggeraction could change this after logging off and on again ^_^

Spectre1337 02-07-2002 03:25 AM

I might need a bit more help than that.... I didnt know it would be so hard... Any samples of NPCs (not only shadow) would be very appreciated:) thanks

Spectre1337 02-07-2002 03:37 AM

How would I make the fire from a putexplosion go accross the screen until it hits something like you were talking about? :( :confused: :(

joseyisleet 02-07-2002 04:04 AM

-=Josey=-
Lol. I checked this post before I went so I'll help you out a bit. ;P

Ok I'm considering that you've already made the first part of it so use something like:

if (weaponfired){
timeout=.05;
}
if (timeout){
this.x+=.5;
doFire();
}
function doFire(){
if (!this.x=0){
putexplosion <yourthinghere>,this.x,playery;
timeout=.05;
} else {
timeout=0;
this.x=playerx+1;
}

I'd use something similar to that. Considering I'm tired and just wrote this it may not be right. So just mess around with it. Using vecx and vecy would make it a whole lot simpler. ;D

joseyisleet 02-07-2002 04:05 AM

-=Josey=-
Quote:

Originally posted by TDO2000


the NPC getting triggeraction could change this after logging off and on again ^_^

What about finishing off the script hmm?

Spectre1337 02-07-2002 04:21 AM

1 Attachment(s)
Problem with that script, check out the screenshot... lol

Wes2000 02-07-2002 05:13 AM

lmao thats funny ;)

All you need to do is change the x+ to a x-. I would reccomend that you also rescript it yourself so that you actually learn to script for yourself and you learn how to fix simple bugs like that one. Last, you need to use onwall to make it stop when it hits a wall (I think you said you wanted it to).

Lomgren 02-07-2002 09:42 AM

Here is a script like what you are making;

NPC Code:

if (isweapon) {
setarray fireshot,3;
}
if (weaponfired) {
fireshot[0] = playerdir;
fireshot[1] = playerx+2*vecx(playerdir);
fireshot[2] = playery+2*vecy(playerdir);
timeout = .05;
}
if (timeout) {
putexplosion 2,fireshot[1],fireshot[2];
fireshot[1]+=vecx(fireshot[0]);
fireshot[2]+=vecy(fireshots[0]);
checkforwalls/players();
if (hitwall==1) {
break;
}
timeout = .05;
}
function checkforwalls/players() {
<insert code here>;
}



I would have put an option for multiple fireshots, but that would have taken longer to write, and that takes time...

dragoonvenganc 02-07-2002 11:01 AM

I dont help dumb people trying to copy stupid stuff make something original and dont ask for a whole script.. noobs.. man.. and the stupid *** bases.. get a life it gets old

joseyisleet 02-07-2002 03:29 PM

-=Josey=-
Well if you took off every spam thread in the NPC scripting part, it wouldn't have very many posts, almost everyone spams. Spectre I said to use vecx and vecy for it. If you can't even script why come here and ask for stuff? You could also use playerdir but that would be useless if they shot it and their dir was 0 then they turned and it was 3.... Anyway, weapon NPCs are pointless. They don't make a server good.

Faheria_LAT1 02-07-2002 03:43 PM

Quote:

Originally posted by Spectre1337
Problem with that script, check out the screenshot... lol
The 'S' Image belongs to Faheria, it was made by Shadrock or Justin and you cannot use it online k? >_<

Saga2001 02-07-2002 03:51 PM

Speaking of this, how do u unset backpals?

nyghtGT 02-07-2002 03:52 PM

Quote:

Originally posted by Saga2001
Speaking of this, how do u unset backpals?
to set the backpal to normal do:

setbackpal pics1.png

Saga2001 02-07-2002 04:02 PM

Quote:

Originally posted by joseyisleet
-=Josey=-
Well if you took off every spam thread in the NPC scripting part, it wouldn't have very many posts, almost everyone spams. Spectre I said to use vecx and vecy for it. If you can't even script why come here and ask for stuff? You could also use playerdir but that would be useless if they shot it and their dir was 0 then they turned and it was 3.... Anyway, weapon NPCs are pointless. They don't make a server good.

dude, whine somewhere else, make them quality, not quantity...kapisch?

dragoonvenganc 02-08-2002 10:33 AM

Saga... anything about the system.. are u working on it.. u done..
u quite.. i need an answer


All times are GMT +2. The time now is 03:43 PM.

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