Create a free account to remove all ad content.

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

0 Members and 1 Guest are viewing this topic.

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #30 on: January 13, 2016, 07:26:33 PM »
Use the script command to call other scripts from your main PlayerJoin script.
Is there a limit to how many Script commands the game can load up during a player join? I have many at this point, and they don't all load. Or some certain order of execution. Especially with seteventitemswing.
Focus determines reality...

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #31 on: January 13, 2016, 09:22:35 PM »
Is there a limit to how many Script commands the game can load up during a player join? I have many at this point, and they don't all load. Or some certain order of execution. Especially with seteventitemswing.
There is no limit. If they don't all load then one of us has made a mistake somewhere.

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #32 on: January 13, 2016, 10:47:21 PM »
There is no limit. If they don't all load then one of us has made a mistake somewhere.
Good to know. Probably my mistake somewhere. The scripting is very complex, and even thoughI have had much success, I still have much to understand.
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #33 on: January 16, 2016, 10:18:09 AM »
I may know where I am going wrong, but don't know how to figure it out. On 3 of my item swing scripts, they're are script 'trees'. So I have all related scripts set to run on player join. I believe this may be causing them to not function. If I run them all manually, they work perfectly. The trial and error is tedious, and I know I'm close. Here's 1.

5 script item swing;

Script 1 magicmushroom

If
Is Equipped [Red Mushroom] [true]
Then
SetEventScript [Itemswing] [Red Mushroom] [magicmushroom\manabuff]
End If

Script 2 manabuff

Script [magicmushroom\manaboost]
Script [magicmushroom\rminv]
Script [magicmushroom\mbcancel]

Script 3 manaboost

If
HasHistory [mana] [player] [true]
Then
History [mana] [player] [100]
Loop
End If

Script 4 rminv

If
HasInventory [player] [Red Mushroom] [true]
Then
Inventory [player] [394,3008,288] [Red Mushroom] [1]
End If

Script 5 mbcancel

Wait [30000]
Script [magicmushroom\manaboost] [cancel]

And that's it. Like I said, this works, but I don't know what parts needed to be on the player join or not to make it auto-work. Otherwise I have to run the script for everyone that joins.
« Last Edit: January 17, 2016, 09:15:37 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 #34 on: January 16, 2016, 03:37:38 PM »
but I don't know what parts needed to be on the player join or not to make it auto-work. Otherwise I have to run the script for everyone that joins.
You don't need script 1 at all, just put this command into the PlayerJoin script:

SetEventScript [Itemswing] [Red Mushroom] [magicmushroom\manabuff]

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #35 on: January 16, 2016, 10:36:11 PM »
You don't need script 1 at all, just put this command into the PlayerJoin script:

SetEventScript [Itemswing] [Red Mushroom] [magicmushroom\manabuff]

Thanx. I'll do that.
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #36 on: January 23, 2016, 12:09:39 AM »
Scripting for DD is going well for me. My map now has mana, hunger, thirst and sanity player status effects. All but sanity are perfectly functioning. Also many items are now 'enchanted'. I am going to start a 'your world' thread soon, to better share the content of 'Castlevania', and keep this 1 open for DD script questions.
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #37 on: January 25, 2016, 12:46:10 AM »
Ok I think I have finally bitten off more than I can chew. My sanity scripts are working, that is to say the amount you have and it's up/down ability. However getting the effects to work properly is a whole other matter. The following script is the culmination of my attempts.


sanity\insanityfx

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] [=] [0]
Then
   Script [sanity\0chance]
   Loop [30000]
End if
   Loop [1000]

So this is complex to me because sanity goes back n forth, not just ticking down then refill completely like my hunger script.

And if this takes 1;

If
   HasInventory [player] [Cooked Duck Meat] [true]
Then
   Inventory [player] [x,x,x] [move] [Cooked Duck Meat] [1]
End If

Then why does this take 2?

If
   HasInventory [player] [Bottle Of Water] [true]
Then
   Inventory [player] [x,x,x] [move] [Bottle Of Water] [1]
End If
« Last Edit: January 25, 2016, 02:32:39 AM by Craig »
Focus determines reality...

Rev Elevenclaw

  • Sr. Member
  • *
  • Posts: 372
    • View Profile
  • Xbox: Rev Elevenclaw
Re: Scripting in dig deep
« Reply #38 on: January 25, 2016, 01:14:10 AM »
Well that's annoying...
Focus determines reality...

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Scripting in dig deep
« Reply #39 on: January 25, 2016, 02:33:06 AM »
Well that's annoying...
I put NoBBC tags around the script