Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   PlayerWorlds Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=15)
-   -   Joint Project 1: Baddies (https://forums.graalonline.com/forums/showthread.php?t=69952)

Tyhm 11-09-2006 12:02 AM

Joint Project 1: Baddies
 
I'm itching to do something. The trouble is, I haven't scripted in a while and lack a server to test on...and I don't really feel like limiting it to one world anyway.

Let's bring baddies back. Seriously, that's what's missing more than anything - a default, simple, Rar-stabby-stabby baddy. Each server makes their own from the ground up, let's give them a template at least to edit.

I still got the ganis, and I got the script for a Virtual NPCed baddy in GS1 around here somewhere...anyone up for seeing this project to fruition?

zell12 11-09-2006 12:06 AM

Sounds interesting Tyhm. ;)

Curt1zzle 11-09-2006 12:32 AM

Your enthusiasm makes me chuckle.

Minoc 11-09-2006 12:34 AM

I miss the baddies.

zell12 11-09-2006 12:37 AM

Loved the baddies, trying to get them all grouped together and try to angle it right so all you have to do is swing. :p

Tyhm 11-09-2006 12:39 AM

Quote:

Originally Posted by Curt1zzle (Post 1240959)
Your enthusiasm makes me chuckle.

I'll grant, the fact that it hasn't been done yet makes me a touch uneasy - am I missing something important? Does the clientside movement of NPCs no longer work? Have the Move commands been removed?

I mean, I could make a g'dawful Projectile Baddy, that just shoots itself very-very-slowly across the room, drops a Confused baddy when it hits a wall...

_Z3phyr_ 11-09-2006 01:05 AM

I am a self-qualified GS1->GS2 translator.

How long is the script?

kinetaro 11-09-2006 01:17 AM

Personally I like scripting my own systems, but this does sound cool, and if you explain each portion of the script, scripting "noobs" can break it down for educational purposes. Also depending on the baddy type you are planning on doing classic styled servers can use it as a base to build off of.

-yes for those of you who care.. kinetaro does script now.. I wanted to be a tripple threat, dancing, singi.. I mean.. uhh.. bye..

Tyhm 11-09-2006 01:19 AM

...finding it's proving a bit of a chore; I found the Baddy Skins tester, let's see if I was bright enough to use the same ganis for each...^^;;

kinetaro 11-09-2006 01:28 AM

Well if you are having problems I think several people would be willing to assist you, just give them a pm asking for their help.

ryu_no_bishie 11-09-2006 03:00 AM

Quote:

Originally Posted by Tyhm (Post 1240944)
I'm itching to do something. The trouble is, I haven't scripted in a while and lack a server to test on...and I don't really feel like limiting it to one world anyway.

Let's bring baddies back. Seriously, that's what's missing more than anything - a default, simple, Rar-stabby-stabby baddy. Each server makes their own from the ground up, let's give them a template at least to edit.

I still got the ganis, and I got the script for a Virtual NPCed baddy in GS1 around here somewhere...anyone up for seeing this project to fruition?

i hope if you persue this you do two things, 1 a gs2 version, and 2 make the baddies simply be a set of actions that it can take for easy editing

id love to benifit from this but as my server is going to have tank movement there wont be any benifits

Tyhm 11-09-2006 04:11 AM

*shrugs* You could always skin a baddy-tank. Body: tank, head: Turret, script: Archer.

I'm looking forward to it; I always wanted to script stuff like Baddy Rodeo, where you jump on one's shoulders and beat it over the head with your shield to steer it. But 1), didn't have the frames on body.png for it, and 2), couldn't override Stefan's scripts on 'em.

The real hangup now is it wasn't as scripted as I thought, so the whole "look this way, face that way" aspect's gonna be tricksy.

Sulukra 11-09-2006 04:27 AM

The problem is that most servers have their own weapon systems these days. If there was some server that was pure classic goodness and was to make good use of baddies, yeah, it'd be worth it.

ryu_no_bishie 11-09-2006 04:35 AM

Quote:

Originally Posted by Tyhm (Post 1241048)
*shrugs* You could always skin a baddy-tank. Body: tank, head: Turret, script: Archer.

I'm looking forward to it; I always wanted to script stuff like Baddy Rodeo, where you jump on one's shoulders and beat it over the head with your shield to steer it. But 1), didn't have the frames on body.png for it, and 2), couldn't override Stefan's scripts on 'em.

The real hangup now is it wasn't as scripted as I thought, so the whole "look this way, face that way" aspect's gonna be tricksy.

no they move like a tank, if youve ever played vector graphic games youll know what im talking about.

Tyhm 11-09-2006 08:03 AM

Quote:

Originally Posted by Sulukra (Post 1241055)
The problem is that most servers have their own weapon systems these days. If there was some server that was pure classic goodness and was to make good use of baddies, yeah, it'd be worth it.

Doesn't bother me. I'll include a super-basic system NPC, the names can easily be changed - presumably, all system NPCs override the player hitting something by calling or triggering an action on the target struck. Whether that's playerhityou(playerid,playerx,playery,playerdir) or struck(fromx,fromy,fromdir), it's all rather immaterial.

Novo 11-09-2006 08:29 AM

Movement on Clientside doesn't work. NPCs don't really co-relate clientside, besides the this.save[] arrays ( which are limited )

The direction + face look can easily be simulated by three ganis: Look straight, Look Left, and Look Right. (unless you want a forth... Look Behind! Which is just awkward )

Movement could be easily done by serverside moves... But they won't be as responsive as clientside in the early days.

Now there's a clientside-serverside portion -- I don't know if that's considered. It might be elaborate to work that out.

Tyhm 11-09-2006 09:28 AM

A clientside-serverside portion?

I remember back in the day, the baddies would work just fine on the first computer in the room, then screw up for everyone else...I wonder, would it be possible to have the server (or leader) handle "Wandering", then when it hits hunt-mode go off the hunted's connection? That way the one attacking you is perfectly smooth (or as smooth as Clientside ever is), and the ones wandering aren't. Makes 'em hackable I suppose, you could send a packet saying "Nope, not here", but by that point you're doubtless hacking that the arrows are missing anyway...

soulwazza 11-09-2006 09:44 AM

Tyhm to save classic

Andy0687 11-09-2006 08:43 PM

Tyhm I have a place you can test all this stuff if you really want to give it a shot.

Ill get in contact with you if you really want, and ill even help out :P I cant find much to help anyone with these days anyways.

kinetaro 11-09-2006 11:47 PM

here is a very basic script for clientside NPC movement.
NPC Code:

//#CLIENTSIDE
function onCreated()
{
showcharacter();
headimg = "head.png";
bodyimg = "body.png";
swordimg = "sword1.png";
shieldimg = "shield1.png";
this.speed = 0.5;
setTimer(0.1);
}
function onTimeout()
{
setcharani("walk", NULL);
for(pl: players) {
this.dir = getdir(pl.x - this.x, pl.y - this.y);
this.angle = getangle(pl.x - this.x, pl.y - this.y);
this.x = this.x + (cos(this.angle) * this.speed);
this.y = this.y - (sin(this.angle) * this.speed);
}
setTimer(0.05);
}


and to make it serverside its basically the same exact thing.
NPC Code:

function onCreated()
{
showcharacter();
headimg = "head.png";
bodyimg = "body.png";
swordimg = "sword1.png";
shieldimg = "shield1.png";
this.speed = 0.5;
setTimer(0.1);
}
function onTimeout()
{
setcharani("walk", NULL);
for(pl: players) {
this.dir = getdir(pl.x - this.x, pl.y - this.y);
this.angle = getangle(pl.x - this.x, pl.y - this.y);
x = this.x + (cos(this.angle) * this.speed);
y = this.y - (sin(this.angle) * this.speed);
}
setTimer(0.05);
}


Tyhm 11-10-2006 03:21 AM

andy: Yes, definitely. I can develop like a madman offline, but that doesn't do anyone any good these days.

Kintearo: Thanks immensely; I do my best work when I'm modifying something that works.

I'm curious: if one were to switch between the two (let clientside movement take over for a while, transfer back when the player dies/leaves), would the second player see the movement still? Jerky, sure- it always was, even with the originals- but could he still participate even as the baddy homes in on #1?

Tyhm 11-10-2006 05:13 AM

3 Attachment(s)
Baddy Experiment 1: The Frog.

Terribly simple, and that's the point.

The script (note the constant references to clientside classic-style):

NPC Code:

if (created) {
showcharacter;
dontblock;
setcharprop #3,frog.png;
setcharani tyhm_frog_baddy_rustle,;
}
if (playerenters||timeout) {
if (isleader) {
if (this.counter==1) {
setcharani tyhm_frog_baddy,;
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter < 5){
hide;
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show;
}
this.counter+=0.05;
}
if (this.attacking > 0) {
if(playerx in |x-2,x+2| && playery in |y-4,y+1|){
hitplayer 0,1,x,y;
}
}
timereverywhere;
timeout=0.05;
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
this.vulnerable = 0;
this.counter=0;
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
destroy;
}



Timing's way off, gani's smoother but not quite as Correct - point is, this is the theory.

Tyhm 11-10-2006 05:32 AM

Attempted translation (someone else can figure out if it even works at all):

NPC Code:

function onCreated() {
showcharacter();
dontblock();
headimg = "frog.png";
setcharani("tyhm_frog_baddy_rustle",NULL);
setTimer(0.1);
}
function onTimeout() {
if (this.counter==1) {
setcharani ("tyhm_frog_baddy",NULL);
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter < 5){
hide();
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show();
}
this.counter+=0.05;
if (this.attacking > 0) {
//frankly, this part needs to be customized to each damage system anyway.
}
setTimer(0.05);
}

function onWa****(){
struck();
}
function onWasShot(){
struck();
}
function onExploded(){
struck();
}

function struck(){
if(this.vulnerable>0){
setcharani("baddydead",NULL);
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay(greenrupee);
else if (temp.i<6) lay(bluerupee);
else if (temp.i<9) lay(heart);
setTimer(0);
this.revive=1;
hide();
}
}

function onPlayerEnters(){
if (this.revive>0){
setTimer(0.05);
this.revive=0;
this.counter=5;
}
}


Tyhm 11-10-2006 06:00 AM

3 Attachment(s)
Haven't bothered scripting this one yet...the next logical step. If this one does well I can start on snipe-archers, then regular Baddies, then archers/dragons.

kinetaro 11-10-2006 03:40 PM

Quote:

Originally Posted by Tyhm (Post 1241402)
I'm curious: if one were to switch between the two (let clientside movement take over for a while, transfer back when the player dies/leaves), would the second player see the movement still? Jerky, sure- it always was, even with the originals- but could he still participate even as the baddy homes in on #1?

I am not sure what you mean, I think you are talking about having the baddy move clientside and serverside so other players can help fight the baddy, but this doesnt make any sense, if you wanted everyone to be able to fight the baddy just make it fully serverside. If that is not what you meant please explain in more detail.

Tyhm 11-11-2006 11:04 AM

A little of each.

Say Client 1 and Client 2 enter a room. Baddy A is walking around on Serverside Control, but its clientside script is also running a local timeout loop on Clients 1 and 2 to see if the baddy sees them.
Client 1 walks in front of Baddy A - this triggers his local script, and Baddy A stops moving Serverside, instead moving per the script running on Client 1's computer. It moves, it attacks, all as fluidly as a clientside script.
Client 2 runs up behind and attacks Baddy A:
Does he see Baddy A still standing where it left Serverside Movement?
Is Baddy A jumping around based on Client 1's lag?

*shrugs* Something like that.

Tyhm 11-11-2006 11:32 PM

Quote:

Originally Posted by Tyhm (Post 1241459)
Attempted translation (someone else can figure out if it even works at all):

[/code]

Important: Forgot right before show; or show();, should say
setcharani tyhm_frog_baddy_rustle,;

Looks really weird otherwise.

Anyone got a chance to see if this works?

Tyhm 11-13-2006 01:10 AM

Swampsoldier ready for conversion
 
3 Attachment(s)
NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,baddygray.png;
setcharani tyhm_swamp_baddy_hide,wbow1.png;
hearts=2;
this.counter=3.6;
hide;
}
if (playerenters||timeout) {
if (isleader) {
if (this.counter==1.5) {
// putleaps 0,x,y;
setcharani tyhm_swamp_baddy_shoot,wbow1.png;
}else if (this.counter <3) {
//there's a clever way to do the following in one line.
//I don't particularly care, though.
if (abs(playerx-x)>abs(playery-y)){
if(playerx<x) dir=1;
else dir=3;
}else{
if(playery<y) dir=0;
else dir=2;
}
this.vulnerable = 1;
if (this.counter == 1.8) {
setshootparams wasshot,1;
shoot x,y+0.5,1,(dir+1)*1.57,0,-1,adv_shot,advshot1.png;
//shootarrow dir;
}
} else if (this.counter < 4.4){
this.vulnerable = 0;
hide;
} else {
this.counter = 0;
setcharani tyhm_swamp_baddy_rustle,wbow1.png;
show;
}
this.counter+=0.05;
}
timereverywhere;
timeout=0.05;
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
hearts--;
setcharani baddyhurt,;
if (hearts<=0){
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
destroy;
}
}


I leave the Putleaps problem to people smarter than I - I scripted it into the gani, but it doesn't seem to Go. If I gotta gani the leaves in, I will, I'd just rather not.

Tyhm 11-13-2006 04:29 AM

I wish there was a way I could go back a few posts and just edit the original Frog posting...there probably is on graal.net or something, but I never did understand that site.
Oh well, here's the most recent version in OldScript...I'll start updating the NewScript as soon as I can get on a test server.

It'd be nice if Code mode didn't doublespace too...
NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,frog.png;
setcharani tyhm_frog_baddy_rustle,;
}
if (playerenters||timeout) {
timereverywhere;
timeout=0.05;
if (isleader) {
this.counter+=0.05;
if (this.counter==0) {
timeout=1;
this.counter=1;
}else if (this.counter==1) {
setcharani tyhm_frog_baddy,;
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter == 4){
hide;
timeout = 1;
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show;
setcharani tyhm_frog_baddy_rustle,;
}
}
if (this.attacking > 0) {
if(playerx in |x-2,x+2| && playery in |y-4,y+1|){
hitplayer 0,1,x,y;
}
}
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
this.vulnerable = 0;
this.attacking = 0;
hide;
timeout = 0;
}


Tyhm 11-20-2006 01:57 AM

- so nobody thinks this project's dead -
Been retooling the baddies using the Projectile theory: If a Projectile knows when it hits something, then having the frogs just be patches of grass that fire frog-shaped projectiles towards the sun should work...

Also, code is now posted on graal.net, since I can edit my posts THERE...

WanDaMan 11-20-2006 12:32 PM

Could I use these? :O!

Tyhm 11-21-2006 12:54 AM

Feel free, they're gonna be general use once the project's done...if you come up with a clever way to serverside one of the scripts I'd appreciate you sharing 'em is all. These are supposed to be The Generic Baddies Every Server Starts With, so basic servers can have clientside-era quests again.

Inverness 12-18-2006 08:45 PM

Do you still need a server to test on?
Wouldn't mind giving you RC on Aeon.

Tyhm 12-20-2006 05:35 AM

I got one at the moment, thx...I got more server than time-and-energy as it stands...I could test the frog, but that's about it.

Tyhm 01-20-2007 11:57 PM

Updates -
Lost access to the one server I had access to.
Doesn't change much, though -
came to the realization I was trying to rescript the Dievil class from Kingdoms.
Currently trying to beg that script off Stefan...he says it won't work at all without a system NPC designed to work with it...I have only dim memories of how it worked in the first place, but I think it could work on a generic server...

Inverness 01-21-2007 02:24 AM

Quote:

Originally Posted by Tyhm (Post 1266820)
Updates -
Lost access to the one server I had access to.

=P Want to take up on my offer then?

Tyhm 01-21-2007 03:23 AM

Yeah, I'll PM you when I got something worth testing...:-P


All times are GMT +2. The time now is 01:03 AM.

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