ACS Buy Menu Help

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
ForrestMarkX
Forum Regular
Posts: 132
Joined: Sat Jun 16, 2012 2:04 am
Location: Texas

ACS Buy Menu Help

#1

Post by ForrestMarkX » Fri Jun 21, 2013 8:03 am

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
Last edited by ForrestMarkX on Sat Jun 22, 2013 6:48 am, edited 1 time in total.
Image[url=steam://friends/add/'.76561197997881512.']Image[/url]

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: ACS Buy Menu Help

#2

Post by Lollipop » Fri Jun 21, 2013 9:46 am

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.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Zupoman
Forum Regular
Posts: 110
Joined: Tue Jun 26, 2012 6:30 pm

RE: ACS Buy Menu Help

#3

Post by Zupoman » Fri Jun 21, 2013 12:08 pm

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).
Last edited by Zupoman on Fri Jun 21, 2013 12:09 pm, edited 1 time in total.
This signature is empty and useless, I would write another useless idiotism here but people will call me a noob for that, so sorry, no more signatures for you. Go somewhere else.

User avatar
ForrestMarkX
Forum Regular
Posts: 132
Joined: Sat Jun 16, 2012 2:04 am
Location: Texas

RE: ACS Buy Menu Help

#4

Post by ForrestMarkX » Fri Jun 21, 2013 10:59 pm

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
Image[url=steam://friends/add/'.76561197997881512.']Image[/url]

Zedek The Plague Doctor
 
Posts: 52
Joined: Sun Aug 05, 2012 3:25 am
Location: Dancing Robot Factory In Hell
Clan: OLAF METAL
Clan Tag: [OLAF]
Contact:

RE: ACS Buy Menu Help

#5

Post by Zedek The Plague Doctor » Fri Jun 21, 2013 11:35 pm

Bumpin' this. The actual look of the menu itself should stay the same, but the way it works should change.

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: ACS Buy Menu Help

#6

Post by Catastrophe » Sat Jun 22, 2013 1:29 am

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.

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: ACS Buy Menu Help

#7

Post by ibm5155 » Sat Jun 22, 2013 1:34 am

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?)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Zedek The Plague Doctor
 
Posts: 52
Joined: Sun Aug 05, 2012 3:25 am
Location: Dancing Robot Factory In Hell
Clan: OLAF METAL
Clan Tag: [OLAF]
Contact:

RE: ACS Buy Menu Help

#8

Post by Zedek The Plague Doctor » Sat Jun 22, 2013 2:26 am

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.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: ACS Buy Menu Help

#9

Post by Watermelon » Mon Jul 08, 2013 9:41 pm

All drawing should be done clientside. There are multiple ways to signal this for clients.

Post Reply