Create a free account to remove all ad content.

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

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #40 on: January 25, 2016, 02:41:47 AM »
If
   HasHistory [sanity] [player] [>=] [76]
Then
   Script [sanity\75chance] [cancel]
   Script [sanity\50chance] [cancel]
   Script [sfx\viewaskewundo]
   Script [sanity\0chance] [cancel]
Else if
   HasHistory [sanity] [player] [<=] [75]
   Script [sanity\50chance] [cancel]
Then
   Script [sanity\75 chance]
   Loop [60000]
Else if
   HasHistory [sanity] [player] [<=] [50]
   Script [sfx\viewaskewundo]
Then
   Script [sanity\50chance]
   Loop [60000]
Else if
   HasHistory [sanity] [player] [<=] [25]
   Script [sanity\0chance]
Then
   Script [sanity\25chance]
   Loop [60000]
Elseif
   HasHistory [sanity] [player] [=]

Then
   Script [sanity\0chance]
   Loop [30000]
End if
   Loop [1000]

I don't know if the errors above are just typos in your post or actual errors in your real script on xbox.

The HasHistory check on line 9 (highlighted in red) is redundant because the script can only get to line 9 if the HasHistory check on line 2 fails, i.e. if sanity <= 75
The script commands you have in the conditional blocks (highlighted in yellow) might be throwing the remaining script execution off.

Because there are no other conditionals in the if block starting at line 8, apart from the redundant HasHistory check, it is effectively an else block, so the following then block (starting at line 11) will always be executed if line 2 fails (sanity <= 75), meaning the remaining Elseif/Then blocks can never be executed.
« Last Edit: January 25, 2016, 02:45:24 AM by Craig »

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #41 on: January 25, 2016, 03:07:33 AM »
I don't know if the errors above are just typos in your post or actual errors in your real script on xbox.

The HasHistory check on line 9 (highlighted in red) is redundant because the script can only get to line 9 if the HasHistory check on line 2 fails, i.e. if sanity <= 75
The script commands you have in the conditional blocks (highlighted in yellow) might be throwing the remaining script execution off.

Because there are no other conditionals in the if block starting at line 8, apart from the redundant HasHistory check, it is effectively an else block, so the following then block (starting at line 11) will always be executed if line 2 fails (sanity <= 75), meaning the remaining Elseif/Then blocks can never be executed.

They are errors. I have been moving things around in the script, experimenting to make it work. I will try to put them in proper spots again. As far as line 9 is concerned... Good point there. I have removed it.
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #42 on: January 25, 2016, 06:23:30 AM »
I decided to 'break it down' a bit to accomplish concept. So I wrote a simple script, it works. However, the script it activates has a IsRandom in it and I believe randomization  isn't working. If I run it manually the 'then' runs, but on active mode in game it runs one or the other only. Here's the concept script;

Script 1 always runs, sanity\75sanity

If
   HasHistory [sanity] [player] [<=] [75]
Then
   Script [sanity\75chance]
   Wait [10000]
Else
   Script [sanity\75chance] [cancel]
End If
Loop [1000]

Script 2 activated by script 1, sanity\75chance

If
   IsRandom [1,2]
Then
   Script [put your own script here]
Else
   Notify [blah blah] [global] [0,0,0]

Need verification. Don't forget this is for DD.



« Last Edit: January 25, 2016, 06:56:52 AM by Rev Elevenclaw »
Focus determines reality...

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #43 on: January 25, 2016, 06:52:57 AM »
I decided to 'break it down' a bit to accomplish concept. So I wrote a simple script, it works. However, the script it activates has a IsRandom in it and I believe randomization  isn't working. If I run it manually the 'then' runs, but on active mode in game it runs the 'else'. Here's the concept script;

Script 1 always runs, sanity\75sanity

If
   HasHistory [sanity] [player] [<=] [75]
Then
   Script [sanity\75chance]
   Wait [10000]
Else
   Script [sanity\75chance] [cancel]
End If
Loop [1000]

Script 2 activated by script 1, sanity\75chance

If
   IsRandom [1,2]
Then
   Script [put your own script here]
Else
   Notify [blah blah] [global] [0,0,0]

Need verification. Don't forget this is for DD.
Maybe it'd be better if your describe in words what you're trying to do with sanity.

I'm 100% positive the IsRandom command works correctly.
The line in red doesn't do anything because sanity\75chance is not a looping script.
What does the script in yellow do?

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #44 on: January 25, 2016, 07:14:29 AM »
This is hard to explain for me. My sanity script works like a slide bar where it can go up and down based on what you do\encounter. So far, 3 things bring it down and there are 3 ways to bring it up. At 75, 50, 25, and 0 a script activates for chances to experience 'insanity effects'.


I'm 100% positive the IsRandom command works correctly.
The line in red doesn't do anything because sanity\75chance is not a looping script.
What does the script in yellow do?

Ok, you would know, I trust in that:) I will remove the red line. The yellow activates a simple cctv script that runs for 300 ms.
« Last Edit: January 25, 2016, 07:17:26 AM by Rev Elevenclaw »
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #45 on: January 25, 2016, 08:44:51 AM »
I scrapped the 1 script method in trade for 4 independent scripts. They work awesomely! However, still no random. Maybe it is the way I have the chance activate a script. But I didn't see another way. IDK, but only the 'else' is working on IsRandom. Tested with all 4 scripts running for 30 mins. 'then' never happened.

Edit. Ran online and 1 of them worked, maybe a 2nd once. Seems circumstantial.
« Last Edit: January 25, 2016, 10:51:58 AM by Rev Elevenclaw »
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #46 on: January 26, 2016, 09:30:20 AM »
I need more scriptable insanity effects. Any ideas?
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #47 on: January 27, 2016, 08:10:23 AM »
And just like that, BAM! The idea hits you and you figure it out. IsRandom confirmed in DD. The scripting program didn't like my arrangement, so I rearranged. Now all is good:)
Focus determines reality...

SEARCH AND CRY

  • Jr. Member
  • *
  • Posts: 16
    • View Profile
  • Xbox: SEARCH AND CRY
Re: Scripting in dig deep
« Reply #48 on: January 27, 2016, 07:22:50 PM »
i can solve all your problems in a few minutes with you Rev

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #49 on: January 28, 2016, 02:52:21 AM »
i can solve all your problems in a few minutes with you Rev

Oh I got sorted. However, any advise or insight is always welcomed by this newbie scriptor. I do still need ideas for insanity effects...
Focus determines reality...