Page 1 of 1
ACS Buy Menu Help
Posted: Fri Jun 21, 2013 8:03 am
by ForrestMarkX
I'm having a problem with a ACS Buy Menu that is activated by a linedef, what happens is if you die or someone leaves or spectates while in the menu it will either open for someone else and can't be closed or it stays open for you after you die and can't be closed. I have no idea how to fix this
Here is the ACS Code
http://pastebin.com/qsWXBHmn
RE: ACS Buy Menu Help
Posted: Fri Jun 21, 2013 9:46 am
by Lollipop
The only advice I can give you is to try and look at Ænima's merc doom thing, it got a buy menu, you could look at the way it activates and such.
RE: ACS Buy Menu Help
Posted: Fri Jun 21, 2013 12:08 pm
by Zupoman
ForrestMarkX wrote:
I'm having a problem with a ACS Buy Menu that is activated by a linedef, what happens is if you die or someone leaves or spectates while in the menu it will either open for someone else and can't be closed or it stays open for you after you die and can't be closed. I have no idea how to fix this
Just two things to remark quickly.
"code" block is horrible at pasting a lot of code, use some pastebin for code of that size next time.
also, bigger is code you submit when you ask for help, smaller is the chance that anybody will bother to look into it. And combined with that "code" block, it makes things even worse.
And about the topic:
- Script 100 is CLIENTSIDE. I believe it shouldn't, that's is unsafe, and the fact that it draws menu for one player does not make it worth using CLIENTSIDE.
- The menu should disappear when player spectates or dies. That's easy to do, just
assign TIDs to players, then, in menu script, check if player is alive, or in game, this way:
Code: Select all
if(ThingCount(T_NONE, PLAYER_BASE_TID + PlayerNumber())
{ /* Here you should close the menu. */ }
PLAYER_BASE_TID is TID of player with PlayerNumber() of 0 (people usually set it to 1000).
RE: ACS Buy Menu Help
Posted: Fri Jun 21, 2013 10:59 pm
by ForrestMarkX
Zupoman wrote:
And about the topic:
- Script 100 is CLIENTSIDE. I believe it shouldn't, that's is unsafe, and the fact that it draws menu for one player does not make it worth using CLIENTSIDE.
- The menu should disappear when player spectates or dies. That's easy to do, just
assign TIDs to players, then, in menu script, check if player is alive, or in game, this way:
Code: Select all
if(ThingCount(T_NONE, PLAYER_BASE_TID + PlayerNumber())
{ /* Here you should close the menu. */ }
PLAYER_BASE_TID is TID of player with PlayerNumber() of 0 (people usually set it to 1000).
That doesn't appear to work, when you die the store still remains open. I think this whole system needs a rewrite cause it depends on items added to the inventory
RE: ACS Buy Menu Help
Posted: Fri Jun 21, 2013 11:35 pm
by Zedek The Plague Doctor
Bumpin' this. The actual look of the menu itself should stay the same, but the way it works should change.
RE: ACS Buy Menu Help
Posted: Sat Jun 22, 2013 1:29 am
by Catastrophe
I don't think you should be using line defs, but if you insist. What you should be doing is making the display itself, clientsided and make it only appear if a certain clientside variable is set to true, then it'll only pop up for the guy that has it true on his side. If you wanna communicate with the server, what you'd have to do is puke scripts.
RE: ACS Buy Menu Help
Posted: Sat Jun 22, 2013 1:34 am
by ibm5155
I did a clientside menu for change the rainfall settings that i did.
But it´s clientside and only affect just affect the gameplay.
Actually the best think I could sugest is to use a strife like menu system or see how does the buy menu from all out war works.
I don´t know if it exist but maybe some kind of script that only affect each player but it sends information to the server (net clientside?)
RE: ACS Buy Menu Help
Posted: Sat Jun 22, 2013 2:26 am
by Zedek The Plague Doctor
I figured part of it out. I was poking through the code, and I figured out that when the menu closes, it seems to reset the selected weapon in the list to the first. I've noticed in multiplayer that when others close the menu, it resets the selected item for everyone.
I think the problem is with the variables. When one player does something with a variable, it does it for everybody.
RE: ACS Buy Menu Help
Posted: Mon Jul 08, 2013 9:41 pm
by Watermelon
All drawing should be done clientside. There are multiple ways to signal this for clients.