Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add temporary loadout #1567

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

nochinator
Copy link
Contributor

Fixes #1363

Changes proposed in this request:

  • add new SVAR: playertemploadweap, most instances of playerloadweap now use playertemploadweap, some specificly don't (such as the reset button)
  • the reset button has been renamed to "Undo Changes" for clarity
  • when playerloadweap changes it also sets playertemploadweap to the same value
  • playertemploadweap now also can be updated without affecting playerloadweap, with a button on the loadout menu to do so.

other files will be changed to read playertemploadweap instead of playerloadweap.
saving playerloadweap also updates playertemploadweap
playertemploadweap can be updated without affecting playerloadweap
calls a new function that saves the loadout in the same way but only sets playertemploadweap without setting playerloadweap.
@qreeves
Copy link
Member

qreeves commented Jul 10, 2024

You don't need to have engine code for this. You can make a persistent string variable with: defsvarp name value

@nochinator
Copy link
Contributor Author

should clarify the last commit name, undid changes to client.cpp, nothing else

@nochinator
Copy link
Contributor Author

after further testing it seems like persistent variables made with defsvarp is not avalible in the normal way you get an svar ($varname), doing so throws an error in the console that the variable names alias can't be found. after looking at how other scritps get an svar made in this way it seems like it this is the correct way to get such a variable. it also appears that I am defining it correctly.
defining it before the usage does not change anything.
could someone check my usage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Easier way to temporarily change loadout between deaths
2 participants