Cutstuff Forum
Mega Man 8-bit Deathmatch => Help & Editing => Topic started by: Xhatahx on September 02, 2016, 09:28:46 PM
-
Dear Cutstuff Forums:
So I have this ACS code for a custom class.
script 764 (void) clientside
{
ConsoleCommand("snd_pitched true");
ConsoleCommand("eval / $snd_musicvolume 2 snd_musicvolume");
Delay(10*35);
ConsoleCommand("snd_pitched false");
ConsoleCommand("eval * $snd_musicvolume 2 snd_musicvolume");
}
It works, but there are a few problems. As the "clientside" tag suggests, I want this to run on only the player who triggered it. However, I don't have any zerver zkillz or a friend to test this, so I'm not sure it works.
Second problem is that if it runs on bots (offline, at least), it will affect me instead of just affecting the bot (in other words, it shouldn't do anything from my perspective). Those problems are probably connected somewhat.
I hope you can solve this issue.
-Xhatahx
P.S. Why am I writing this like a letter?
-
In order to test it fully, you could open two separate instances of the game.
-
I tried running a server and have two games playing together. I ran it, activated the script, and the other game had it's sound settings changed. Fail.
I'm merely OK at ACS, so I can't do this. Maybe it's impossible?
-
It isn't impossible, clientside scripts are primarily just a pain in the ass to handle.
How are you activating this script? Is it player activated or is it global?
-
It's player activated. Kinda. Maybe.
Ya see, my class has a projectile that spawns an item that's picked up by another player. That item activates the script.
it takes time to join a forum you know
-
After a bit of experimentation, I uncovered the missing piece.
Encompass the structure in the following if statement:
If(PlayerNumber() == ConsolePlayerNumber())
if this doesn't compile, use this ACS compiler instead of what you have: https://www.dropbox.com/s/75agzkbp7uf1h13/acc_8bdm5a.zip?dl=0 (https://www.dropbox.com/s/75agzkbp7uf1h13/acc_8bdm5a.zip?dl=0)
-
Thanks! About 5 of them!
Now I just need to fix... everything else related to online play. :|
But that's enough for now. I'll finish this someday.