Create a free account to remove all ad content.

Author Topic: [Help Needed] Scripting in dig deep  (Read 9679 times)

0 Members and 1 Guest are viewing this topic.

Stoneart

  • Sr. Member
  • *
  • Posts: 261
  • "There's always time to get your block's off"
    • View Profile
    • Discord link to my game (Coven)
  • Xbox: stoneart
  • PSN: Xx_Phoenix_Down_xX
Re: Scripting in dig deep
« Reply #80 on: October 06, 2016, 11:09:34 PM »
Is there a way to isolate specfic players for scripts? As in, my ranking system would work smoother for returning players if there was an IsGamertag script option, but there isn't. Any ideas how to do this?
I never figured this out, so I want to talk about it more.

Just give the players who you want to give the special treatment a separate history the next time they join and use that in your Join Event script.
If
HasHistory [VIP]
Then
Notify: [It's time to party. [Gamertag] has arrived.]

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #81 on: October 07, 2016, 12:10:29 AM »
Well, yeah that is sort of what I had in mind. But not too many people actually play long enough to achieve even rank 2. So my idea was when someone does I make a player join script for them alone.

If
HasPermission [admin)
Then
Script [ranks\rank5]
ElseIf
IsPlayer [gamertag]
Then
Script [ranks\rank2,3,4] (depending)
Else
Script [ranks\rank1]
Endif

Also, it could be used for auto-kicking banned players who try to join. Or running a custom particle effect for a specific player on their chosen avatar. And I would be able to use for jobs too. Using copy to new script and substitutions, this could be used very easily IMO. I wasn't able to figure out how to use histories to do these things.

Edit; I mixed up IsGamertag with IsPlayer. But I think either could work.
« Last Edit: October 07, 2016, 04:13:20 AM by Rev Elevenclaw »
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #82 on: October 08, 2016, 06:33:26 PM »
Well whatever about all that. I'm really trying to figure out how histories work in relation to returning players. For example, my map has hunger scripts. But it defaults when someone rejoins. Instead I would like the game  to 'remember' how low their meter was. If you say just give them some history I will curse you with fleas! Kidding... But seriously, I need specifics here.
Focus determines reality...

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #83 on: October 08, 2016, 06:51:00 PM »
It's might be resetting because the player join script is setting the value directly?

i.e.

PlayerJoinScript:
History [Hunger] [player] [100]

What it should probably do is:
PlayerJoinScript:
if
   HasHistory [Hunger] [player] [false]
then
   History [Hunger] [player] [100]
endif

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #84 on: October 09, 2016, 02:05:50 AM »
It's might be resetting because the player join script is setting the value directly?
Yep, that's totally what's going on. I will have to do some major revisions, but I think I get it now. Thanx for that:)
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #85 on: October 09, 2016, 11:54:58 PM »
Can anyone tell me what time night falls in DD, in relation to IsClock?
Focus determines reality...

.ok

  • Supreme Member
  • *
  • Posts: 2212
    • View Profile
Re: Scripting in dig deep
« Reply #86 on: October 10, 2016, 12:14:02 AM »
what if for all the special effects you wanna give people or to specific people,why not tie all of the effects into individual scripts

then tie all of those onto a bigger script such as

script [effecta]
script [effectb]
ect

and then make a script thats for multiple playerjoins scripts,and include that main script onto the new one for any playerjoins scripts you want to use

so that way the 2nd script when someone joins,the playerjoins script runs it and it check the player for each history,and then activates the proper effect




Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #87 on: October 10, 2016, 01:27:24 AM »
I have that set up already. I need to know for a job related purpose. Also, if times for the and day are equal (12/12). Or if the times change during different HD seasons.
Focus determines reality...

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #88 on: October 10, 2016, 07:58:28 AM »
Can anyone tell me what time night falls in DD, in relation to IsClock?
I'm not sure on the exact answer, but here's a little script you could use to find out.

var [time] = [clock:]
SetText [x,y,z] [[time:2]] // x,y,z should be the coordinate of a sign.
loop [100]

run that and watch the sign until you see the time values you need for the job window start and end, then use those values in your job script:

var [time] = [clock:]
if
  IsVar [time] [>=] [start]  // replace start with whatever was shown on the sign at the start time
  IsVar [time] [<=] [end]  // replace end with whatever was shown on the sign at the end time
then
  // job is available
else
   notify [job window closed]
endif

If the job is overnight, it's possible the end time will be a smaller number than the start time, so you might have to jiggle the if statement to accommodate. e.g. start time might be 18.00 and end time might be 6.00, in which case you'd need to do something like this:

var [time] = [clock:]
if
  IsVar [time] [<] [18.00]
  IsVar [time] [>] [6.00]
then
   notify [job window closed]  // we get here if time is between 6am and 6pm.
else
  // job is available - we get here if time is between 6pm and 6am.
endif
« Last Edit: October 10, 2016, 04:31:14 PM by Craig »

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #89 on: October 10, 2016, 06:58:15 PM »
var [time] = [clock:]
SetText [x,y,z] [[time:2]] // x,y,z should be the coordinate of a sign.
loop [100]
That's awesome!
Focus determines reality...