![]() |
Passing values from Clientside to Serverside
Ookay, I had higher hopes for the Stickies, but given that the optimization guide was written in 2004, I guess I'm out of luck:
Are we seriously still using triggeraction to send data from Clientside to Serverside? And are we seriously still using this.rupees, this.darts, this.hearts to change values on Serverside that Clientside can pick up on? I found triggerserver, and that's great for weapons, but I mean - seriously? Are we still tying "the player just hit me" to a code-arrow, shooting it at the serverside, and praying it hits?! I mean, I'm the first to admit I been out of the game for a while, but if there's a better way I'd love to know what it is... And for those of you who absolutely have to know the context, I'm making a baddy, okay? And right now one baddy runs trigger-to-trigger on the serverside (move to onMovementfinished - and once again, hoorah for a language that buries that tidbit in the newfeatures2001.txt), then looks for an enemy; the clientside looks for an enemy to turn the baddy's head; and the gani runs a timeout too, because it's complicated, (and I'm probably gonna wind up scrapping the gani and moving all that code right back to the clientside script). And right now the only way to tell the Client that the baddy's taken damage is to set this.hearts, and have the client scan it every 0.05 seconds. -_- |
Quote:
Quote:
Quote:
Quote:
|
I think what Tyhm is looking for here is triggering the "other" side of the script without involving coordinates or the chance that other scripts might be hit by it.
|
My point is triggerserver/triggerclient seems to be weapons only, edit rupees/hearts/etc seems to be the only set of variables that ARE visible to Client when they're changed on Server. And clientr. are really playerr, apparently....
And yes, callclient(parameters) would be awesome. |
Quote:
|
Ha, yeah, [0]-[9] and 0-220 I think. And bombs and darts (0-99), and probably swordpower and shieldpower, and I can always shoehorn a meaningful #P1 into a gani without a hat to sneak another string in that way; I'd just rather not if there's a better way.
Apparently there is not. -_- Yet; I fully expect that as soon as I've gone to the trouble something will be released that makes my work unnecessary again... |
Quote:
These are two functions extracted from my triggercontrol class that is used to wrap the triggerserver() and triggerclient() in weapons: PHP Code:
WeaponName.ClientFunction(null, "npcfunction", this.id, "saystuff", "lol I like pancakes"); Or from the client: WeaponName.ServerFunction(null, "npcfunction", this.level.name, this.id, "saystuff", "Inverness was here"); Note that ClientFunction() and ServerFunction() are part of my class, they call a function on the other side and wait for return value. Naturally, I would prefer a hard-coded function, as it would be more efficient. |
Huh?
Yeah, but triggerserver and triggerclient are NPCW only, right? |
Quote:
PHP Code:
PHP Code:
|
Thanks. Godforbid the wiki be up to date...-_-
|
| All times are GMT +2. The time now is 04:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.