Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Buildings can now (ideally) only last 2 hours max #41
base: development
Are you sure you want to change the base?
Buildings can now (ideally) only last 2 hours max #41
Changes from 3 commits
f059cff
d01e591
1951bb4
faf07b2
121a289
64ef442
c20cd5c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split comment over two lines please cos it's quite long, we like to try and keep line length below 100 characters for readability and maintenance purposes
Example PR comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably need remoteExec-ing for the specific player, which means we need to pass the player object into the args for this script.
On player-hosted local development this will work because the server IS the player. But probably won't work on dedicated server.
I think. On phone so bit limited in what I can check easily.
Also, there's a notifications config here https://github.com/Bro-Nation/Paradigm/blob/development/client/configs/notifications.hpp
But that's for "client" functions and this is a "server" function.
Hmmm. I Need to think about this/have a look at the rest of the code path. I wonder if we can do the "too long, are your supplies" notification on whatever script calls this on the client?
Because the interaction overlay already shows how much time is left for supplies, so that value is already available to clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was copying how they did notifications for adding a crate.
https://github.com/Bro-Nation/Paradigm/blob/development/client/functions/basebuilding/fn_resupply_building_with_crate.sqf
if !(_nearbySupplies isEqualTo []) then { ["resupplybuilding", [_target, "CRATE"]] call para_c_fnc_call_on_server; } else { ["TaskFailed",["",localize "STR_vn_mf_nosupplydropnearby"]] call para_c_fnc_show_notification; };
Last line, they call a notification in a very similar way so, I think, it ought work, I do see what you mean though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classic viewing a PR on my phone, I missed the fact
_player
is already in here as a variable. See REhandler note below for more info. What you'll need for this specific line (111) isIt probably won't work on player hosted (local development), but it will work on dedicated server. See I need to refactor a thing because I was lazy note below
REhandler
Mostly a note so we're both aware of what's going on. At the top:
script --> fn_rehandler.sqf
_player
is taken from thepara_s_fnc_rehandler
function's scope. layman's version --para_s_fnc_rehandler
calls this script and the_player
variable still exists so this function can use it, one of those weird sqf things.I need to refactor a thing because I was lazy
I'll need to add this in paradigm (it should really be here in
paradigm/server/remoteExec
anyway but I was being lazy :/ ): https://github.com/Bro-Nation/Mike-Force/blob/development/mission/functions/core/helpers/fn_rExecServerToGlobal_playerHost_or_dedicated.sqfIf you change the line to match the above, I'll do a PR after and switch it to that... or .... you can copy the
vn_mf_fnc_rExecServerToGlobal_playerHost_or_dedicated
function over to paradigm if you want some bonus points for saving me a job?having both
para_s_fnc_rExecServerToGlobal_playerHost_or_dedicated
andvn_mf_fnc_rExecServerToGlobal_playerHost_or_dedicated
should be fine for the time being (i'll fix the other references to thevn_mf
one)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tally, seems like it's just one of those paradigm things. That's all fine then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it does or does not need to change from:
["TaskFailed",["",localize "STR_para_build_maxtimereached"]] call para_c_fnc_show_notification;
to:
[["TaskFailed",["",localize "STR_para_build_maxtimereached"]]] remoteExecCall ["para_c_fnc_show_notification", _player];
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, to clarify
this was specifically about
localize "STR_para_build_maxtimereached"
. just saying i didn't realise they used that method. Mike Force has the notification class name for the most part. Example here.yep, will need the
remoteExec
change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see what you mean, but how does the notification on the resupply_with_crate/sandbag working then?
if !(_nearbySupplies isEqualTo []) then { ["resupplybuilding", [_target, "CRATE"]] call para_c_fnc_call_on_server; } else { ["TaskFailed",["",localize "STR_vn_mf_nosupplydropnearby"]] call para_c_fnc_show_notification; };