dev

textPage 12 of 208
50 messages on this page
Sunday, January 30, 2022
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
But there's 2 runtimes active in the CSMM custom system.
First all the handlebars stuff gets resolved and only after that, the commands and custom functions get executed
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
You're still using everything inside handlebars
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
There'll need to be a few adjustments to your code yeah
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Are you testing on staging or on your own instance?
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
Do I need to make any changes to this code to test it ?
As is I'm getting and API error on the ?second wait (x)?
The log line hooked 4 times in the 10 seconds so it technically should have "fired"
wait(10);
{{#if (lte (getVar (add "player:counter:" player.steamId)) 1)}};
{{delVar (add "player:counter:" player.steamId)}};
say "Command will fail {{getVar (add "player:counter:" player.steamId)}} time.";
{{/if}}
{{#if (gte (getVar (add "player:counter:" player.steamId)) 3)}};
say "Command will fire {{getVar (add "player:counter:" player.steamId)}} time.";
{{/if}}```

Command Parameters Result
wait(10) Waited for 10 seconds
say "Command will fail time."
Waited for 10 seconds An error occurred executing the API request to the 7D2D server```
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Awesome :D
Avatar for bc43431b65cc8f7fb88ae66e5cfbe175a39472cbc3db92f842c7a016ee80c451
User bc4343
I'll be able to have a play with it a bit later today, will let you know ๐Ÿ‘
Saturday, January 29, 2022
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
This works great
  foo
{{else}}
  bar
{{/inArray}}```
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
{{filter server.onlinePlayers "a"}}
also gives me options.inverse is not a function
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
I was trying
  foo
{{else}}
  bar
{{/inArray}}```
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
So depending on the command, you'll need to split on something to turn it into an array
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh it's a string that comes out
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Not sure how to use the data from a
{{execCmd "pd list"}}
. Is it an array? Also, what would be a correct array format? I've tested "a,b,c", "[a,b,c]", "'1','2','3'"...
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
that would mean it's never triggering ;O How are you testing it?
Avatar for 6bbafaadf0e1183243bd245f399a705298a6a8f00a3dcf2c75763ebdbf5a5b1b
User 6bbafa
I tried every combination in the document and 8n searching here. I will give Playground a try and post my findings
Screenshot_20220129-100903_Chrome.jpg

Screenshot_20220129-100903_Chrome.jpg

JPG โ€ข 614.7 KB

Avatar for 6bbafaadf0e1183243bd245f399a705298a6a8f00a3dcf2c75763ebdbf5a5b1b
User 6bbafa
I will try some Playground stuff as I was testing from in game
Avatar for 6bbafaadf0e1183243bd245f399a705298a6a8f00a3dcf2c75763ebdbf5a5b1b
User 6bbafa
Last result isn't recording anything but the above does work
Avatar for 6bbafaadf0e1183243bd245f399a705298a6a8f00a3dcf2c75763ebdbf5a5b1b
User 6bbafa
say "[FF7F00]${player.name} [FFFF00]has reached level [9400D3]${newLvl} [FFFF00]and has earned ${newLvl} Dukes"; giveplus Steam_${player.steamId} casinoCoin ${newLvl}
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Playground will eventually replace that last result info from the settings page
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
^ also available in the playground btw, with a bunch more info available ๐Ÿ˜„
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
No content
unknown.png

unknown.png

PNG โ€ข 41.1 KB

Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
did you check last result in the hook to see what is actually executed?
Avatar for 6bbafaadf0e1183243bd245f399a705298a6a8f00a3dcf2c75763ebdbf5a5b1b
User 6bbafa
Tried this and it didn't work either. Spent an hour testing...
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh and @User 59898394 re the stuff you asked in #csmm-support , about getting the permadeath status of a player
Adding this to staging in a few minutes too.
{{execCmd "command"}}
helper
unknown.png

unknown.png

PNG โ€ข 15.3 KB

Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I can give you admin on my test server on staging if you dont want to add your own server
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
so potentially big impact
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
now they can
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It changes how custom functions get resolved now. Before, they couldn't be nested
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Would either of you mind giving it a test and see what gives? Before I merge it to master?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's going live on staging now
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
buuuut there's no conditional in the customFunction runtime, so I'm not sure if it'll fully solve the usecase
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Also stuff like
setVar("test2", getVar("test"))
will work
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
wait(10);
getVar("aaa")
Will wait 10 seconds before reading the variable
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I hope :O
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's not a full fix to your use case but it should help I think
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
๐Ÿ‘€
This PR will allow you to use persistent variables as custom CSMM functions
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
So summary:
If you use the default Level Up hook from cssm use
{{multiply newLvl 10}}

If you use a custom hook and extract newLvl with regex from logline use
{{multiply custom.newLvl 10}}
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
100% true
Avatar for e5e1a1e030d906e6b0758aa714298a47ac1eb96bd571c5acc968a191bb9574fb
User e5e1a1
Well either way I'm confident ${this} won't work inside a {{helper}}
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
so depending on which it is it need custom.
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
but it could be the internal of hook playerLeveled too
Avatar for e5e1a1e030d906e6b0758aa714298a47ac1eb96bd571c5acc968a191bb9574fb
User e5e1a1
I think it is being picked up by a hook on the CPM level up line
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
And use tha playground if you dont yet. Helps a lot with debugging
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
i think
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
not a custom
Avatar for a506fee3140c1a9cb5f83c4671951bd488e90ca6dc0482bf1cbc5478a2f8fa6e
User a506fe
newLvl is an internal
Avatar for e5e1a1e030d906e6b0758aa714298a47ac1eb96bd571c5acc968a191bb9574fb
User e5e1a1
{{multiply custom.newLvl 10}}
Avatar for e5e1a1e030d906e6b0758aa714298a47ac1eb96bd571c5acc968a191bb9574fb
User e5e1a1
{{helper (variable) 5}}
Avatar for e5e1a1e030d906e6b0758aa714298a47ac1eb96bd571c5acc968a191bb9574fb
User e5e1a1
Including how to do maths and how to nest helpers