![]() |
Joint Project 1: Baddies - trouble with clientside/serverside/GS2 Conversion
I'm trying to assemble a really basic Baddy script over on the Playerworld Main board so everyone will have access to the same sorts of tools we all had back when the world was clientside (but with the added advantage that this time, we can script the baddies to shoot fireballs out of their ears or whatever else we want to modify them to do)-
Point is, I've made a bunch of baddy scripts, but I keep running into a handfull of problems. 1) I don't actually remember how the late GS1 scripts worked - the really efficient Move, Shoot, etc. I jury-rigged a Shoot command for the extant swampsoldier, but I'm getting the standard issue problems - won't shoot over walls, not sure I have the power right (was it -1 for Go Forever, or am I firing them backwards?) Is there a specific place that still lists these in the old NewFeatures2002.txt style? 2) The original Swampsoldier used putleaps0,x,y in its "script" - which is now a clientside-only command, I guess...anyway, I put a ganiscript in to emulate that and it never does anything. Not sure why. Anyone else run into this? 3) Is there a Simple way of saying "Hit by a #1 arrow" short of shootarrow? It'd work fine for the swampsoldier, but shootball (last check) doesn't offer a direction so much as a target. I'm way outta my depth here, so I'd appreciate any help I can get. Everyone's free to do what they like with the finished product, I'd just prefer if all the intermediate work on it was public domain so we don't have a different Basic Baddy Gani for every server, etc. And yes, I'm fully cognizant that every server has a different name for how they handle damage, movement, etc...I hope to, in the final version, have a series of constants or function calls to make it as easy as possible to graft it into whichever system is necessary. |
Quote:
Quote:
HTML Code:
this.attr[1] = "the gani for the putleaps effect"; Quote:
|
Quote:
You know, Massokre would know, I'll ask him. I'm sure he came across this when he was rescripting Classic's Carrying-And-Throwing script. Quote:
Had another thought: Would it be more efficient for the system NPC to detect when a player's touching a baddy than to have each baddy running a constant loop to detect when they touch a player? 'cuz right now, that's the only reason the Frog's got a constant timeout loop...otherwise it could show the rustle, wait 1 second, show the frog, wait 2 seconds, show the rustle, wait 1 second, hide and move, wait, repeat...and when I get scripts moving by the Move command, same story there... |
Quote:
There's no way to turn off wall checking. Also, there's no efficient way to check for a player contacting a baddy. Even if you use playertouchsme, it will check an area in front of the player, and that can get very ugly with opposite boots. It's a bit strange. I think Stefan's reasoning for this is to make the player seem like they didn't lag that sign or level link. A long time ago, I suggested to Stefan that he add an event handler playerEntersArea, that would trigger when the player's area and the area of an NPC intersected. I also had a multitude of applications for such an event handler other than just baddies. serverside-protected spars nopkareas (restricted to the area of the NPC) nopauseareas etc. However, with most of these other applications, you'd want to know when the player leaves the area of an NPC as well, which would be another event handler: playerLeavesArea. This idea would parallel playerenters and playerleaves for levels, except with NPCs detecting the players. It's not necessary for the NPCs to keep track of all players in a level, etc, however, because the script could keep track of it if you needed that kind of implementation. Unfortunately, I don't believe Stefan's interested in adding such a feature. Couldn't hurt to ask though. |
There's a way to put it in a system NPC...as long as it's in a timeout loop anyway, it's trivial and primarily client-lag to have it send playerentersarea(playerid) to any NPCs it's entered the area of, assuming said NPCs have a detectable size.
But yes, it'd be a wonderful feature if Stefan were to add it. In the meantime, I suppose I'll have to keep the baddies scripted with a .05 timeout loop on the off chance players are walking backwards or being pushed by conveyer belts, winds, or strong currents... I suppose it might be possible to just script anything that moves a player unduly to launch playertouchsme() at anything the player's pushed into...a bit of an overhead on that, but with joins, why not? |
If you don't mind using a circle for area detection use
PHP Code:
Could/should also be able to do PHP Code:
|
Well, naturally, it's just a matter of knowing the shape and dimensions of the NPCs in question. I'd figure the rectangle would be good enough...
|
Quote:
A good idea for baddies, is that when their script is created, to make an array level.baddies, and have the baddies each add themselves (as an object) to that array both serverside and clientside. That way, you could more easily detect the baddy's presence clientside and then trigger the server. That would pretty much be a less efficient version of clientside hit detection. |
:-/ Don't like it. Then you ask the player to detect every few seconds whether they've collided with any element of level.baddies.
|
Quote:
|
...having no idea what you just said, I'm going to assume you're right about this. Bitflag...different from boolean...reduces traffic...to less than one bit...
You put a lot of faith in the player honestly telling the server when a baddy's collided with them, but I suppose one must these days. Any playertouchsme solution would require much the same thing. I still say playertouchsme should be manually fired when the player's forced to move by room-based (or goofy-boots-based) script...won't help with the baddies catching the player, but it'd be a start. Hmm, the player's running a timeout loop, the server's running an occasional "Oh yeah and all the frogs on the server jump" every seven seconds or so...I'd think the client knows where even the serverside Frogs are so it can animate them, thus the client would be fully capable of saying "Yeah, I'm on top of a frog right now - what? They're attacking? Damn, sucks to be me." But perhaps I oversimplify. It's been a long day. |
Quote:
Instead of having a swear filter, we could just record words that *could* be deemed offensive. Instead of having serverside damage, we could detect inconsistencies in damage responses. |
Okay, this isn't even GScript so don't laugh..
(Don't know what it is.. just some random theory.) Can't you do like this? NPC Code: then in the baddie script do like "join baddies;" ? |
Twas why i posted those sample codes. Depends on whats the order of preference for baddies in the end. Movement can be handled serverside while detection is clientside.. it won't lag when you get hit but may look odd to other people =S.
|
| All times are GMT +2. The time now is 08:43 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.