Total Miner Forums

Total Miner => Creative Features => Topic started by: Rev Elevenclaw on December 12, 2015, 01:28:06 AM

Title: Scripting in dig deep
Post by: Rev Elevenclaw on December 12, 2015, 01:28:06 AM
Ok so I have been experimenting. Scripting is great, however I seem to be limited in dig deep. Which makes sense due to the nature of the intent of that game style. My problem is that I don't know specifically what those limitations are. Is there a concise list somewhere in the forums? Or a link to the info? I really tried to find one. Please help, otherwise I am left shooting in the dark. TY
Title: Re: Scripting in dig deep
Post by: Jesse on December 12, 2015, 01:45:15 AM
Most block scripts in Dig Deep are the cheaty ones like.
Paste
Inventory
Move region
move block

Those are major ones i know.

Title: Re: Scripting in dig deep
Post by: Faint of Clubs on December 12, 2015, 03:39:54 AM
The limitations are basically that you cannot do anything that you couldn't do manually without the script.
For example you can move inventory from one block to another but cannot spawn new items into their inventory.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on December 12, 2015, 06:18:26 AM
Ok, that is helpful. I presumed I wouldn't be able to use a large portion of them. It is difficult to know sometimes if I simply made a mistake, or if it is a script I can't use. I employ the syntax and diagnostic help when I don't get a result, but it would be nice if it would inform me of 'forbidden in dd' script attempts. Or something. It also took some time to realize the 'y' coordinate is backward in scripting vs. HUD. Anyway, I am still learning it, but I have had good success and would like to add some of the more complex scripts I've seen around. Though I am discouraged to go big until I have a better idea of what I can do.
Title: Re: Scripting in dig deep
Post by: Faint of Clubs on December 12, 2015, 12:09:41 PM
Ok, that is helpful. I presumed I wouldn't be able to use a large portion of them. It is difficult to know sometimes if I simply made a mistake, or if it is a script I can't use. I employ the syntax and diagnostic help when I don't get a result, but it would be nice if it would inform me of 'forbidden in dd' script attempts. Or something. It also took some time to realize the 'y' coordinate is backward in scripting vs. HUD. Anyway, I am still learning it, but I have had good success and would like to add some of the more complex scripts I've seen around. Though I am discouraged to go big until I have a better idea of what I can do.

My gt is tenman420 if you ever have questions :p sorry if I'm busy but I usually get around to Xbox messages within a day
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on December 14, 2015, 11:25:21 PM
Ummm... I tried that. U really didn't seem receptive at the time. I would appreciate being able to privately join your map, so I could have admin, and you could just reload as to ensure I didn't mess anything up. You know, like a programmers tour... Or whatever. That way I could copy down a few scripts to try in my map.  However that wouldn't really solve my dilemma.  That would take someone adjusting the script list in the game or forums with y/n for DD. But at least I could see about adding the survival script to my map. Because it's awesome and would really add life to my RPG.
Title: Re: Scripting in dig deep
Post by: Craig on December 14, 2015, 11:27:44 PM
You know, like a programmers tour... Or whatever.
The View Scripts permission is intended for this type of read only access.
Title: Re: Scripting in dig deep
Post by: Faint of Clubs on December 15, 2015, 01:14:51 AM
Ummm... I tried that. U really didn't seem receptive at the time. I would appreciate being able to privately join your map, so I could have admin, and you could just reload as to ensure I didn't mess anything up. You know, like a programmers tour... Or whatever. That way I could copy down a few scripts to try in my map.  However that wouldn't really solve my dilemma.  That would take someone adjusting the script list in the game or forums with y/n for DD. But at least I could see about adding the survival script to my map. Because it's awesome and would really add life to my RPG.

Hmmm.. To my knowledge you can use histories in dd, but idk about health commands, teleport, or item swing.


Craig?
Title: Re: Scripting in dig deep
Post by: Craig on December 15, 2015, 02:16:40 AM
I think Teleport and ItemSwing are usable in DD.
Health command only allows damage in DD.
Title: Re: Scripting in dig deep
Post by: Faint of Clubs on December 15, 2015, 02:57:28 AM
I think Teleport and ItemSwing are usable in DD.
Health command only allows damage in DD.

Awesome, then by that knowledge I believe a hunger and thirst and sleep system could be implemented into dig deep easily :)
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on December 15, 2015, 05:48:59 PM
Wouldn't that make it crazy?! I can't wait to try it!
Title: Re: Scripting in dig deep
Post by: Trubtavium Recordsmith VII on December 15, 2015, 11:17:26 PM
As a Dig Deep player, I can vouch that any "creative" commands are not available. You can use move scripts, which I often use in replace of clear scripts. Teleporting is also usable. Basically, anything that spawns in items or blocks from thin air is not available.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on December 16, 2015, 07:20:36 AM
That makes sense. I will have to do some tweaking of the survival scripts to slow down or alter the effects. Otherwise new players won't stand a chance. It can be challenging enough to get started in my map for players. I hope to also automate a lot of features in my map thru NPC quest style scripts. With an employment system, economized and itemized shops, and a unique ranking system, there is much ado. I barely get a moment while hosting. Not to mention properties for sale. I have much to learn... I thought making a lighthouse beacon was a tough script... lol. Anyway, thank you all for your insight. I am now just waiting for MS to fix the bug... Impatiently!
Title: Re: Scripting in dig deep
Post by: MsLegit on December 16, 2015, 09:21:55 AM
I have a modded dig deep unlockables map but the host of the map gave it to me if you want you can see some of the scripts I don't have much. The scripts you can't do are like the fill,inventory add/clear ect and clear i'm not sure about the rest of them. Good day!
Title: Re: Scripting in dig deep
Post by: Faint of Clubs on December 16, 2015, 09:53:46 AM
That makes sense. I will have to do some tweaking of the survival scripts to slow down or alter the effects. Otherwise new players won't stand a chance. It can be challenging enough to get started in my map for players. I hope to also automate a lot of features in my map thru NPC quest style scripts. With an employment system, economized and itemized shops, and a unique ranking system, there is much ado. I barely get a moment while hosting. Not to mention properties for sale. I have much to learn... I thought making a lighthouse beacon was a tough script... lol. Anyway, thank you all for your insight. I am now just waiting for MS to fix the bug... Impatiently!

The problem with scripted jobs is you will need to provide the pay for every player who joins. You would basically need a chest that is scripted to refill from another chest when empty, and then it transfers money to players per pay period
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on December 16, 2015, 08:08:57 PM
Yes I believe that be correct. Shouldn't be a problem. I intend a lot of scripts to take over admin duties, so I can focus on other things while hosting. I have my RPG designed to take awhile to get thru. I try to host as much as I can, but get little expansion done unless I'm offline. So I need to bridge that gap. My ultimate goal is to build the best DD RPG ever! And that is gonna take a lot of scripts...
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 06, 2016, 09:31:59 AM
TM is back! So let the scripting begin...
Title: Re: Scripting in dig deep
Post by: TM Charles on January 06, 2016, 10:24:46 AM
I think Teleport and ItemSwing are usable in DD.
Health command only allows damage in DD.
Guns are also possible!
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 06, 2016, 10:16:30 PM
I figured out teleportation, easy. But I don't think itemswing works for DD. I tried to make the 'wand' act as a catalyst. Need verification...
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 07, 2016, 09:47:32 AM
Ok. So itemswing works on DD, sorta. I have to manually run the script once from my list, then it works for the item.  I have tested it a few times by reloading my map, and always have to "run script", to make it work. I doubt this is normal. Bugs?
Title: Re: Scripting in dig deep
Post by: Spark on January 07, 2016, 09:57:19 AM
Ok. So itemswing works on DD, sorta. I have to manually run the script once from my list, then it works for the item.  I have tested it a few times by reloading my map, and always have to "run script", to make it work. I doubt this is normal. Bugs?
Yes, it is normal.
Just put this script on the event driven script menu, when "player join" ^-^
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 07, 2016, 08:14:50 PM
Yes, it is normal.
Just put this script on the event driven script menu, when "player join" ^-^
It's a strange thing to be normal. But whatever. As far as event player join, that spot is already used. Could I use an entering zone script? So it auto runs once upon my entering the map? I have 2 large zones that, between them both, cover the entire world. 1 for upper down to 130, and 131 down for lower.
Title: Re: Scripting in dig deep
Post by: Craig on January 07, 2016, 08:21:12 PM
As far as event player join, that spot is already used. Could I..
No, either just add all the SetEventScript commands to the end of your current PlayerJoins script, or put them all into their own script and call that script from your current PlayerJoins script.

I personally prefer the 2nd option because if you change a script once it's already been set to an event, you need to reset it to the event. Which is a nuisance while developing/testing the scripts. So if they're all in say a script called 'SetItemSwingEvents', then I can just manually run that script immediately after changing one of the item swing scripts to reset, without having to worry about anything else that the PlayerJoins script might be doing.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 08, 2016, 02:54:00 AM
TY for the insight. It didn't occur to me to combine scripts into a 'packet'. A lot of scripting is still a mystery to me. But I am learning...
Title: Re: Scripting in dig deep
Post by: Lord Leo on January 08, 2016, 07:38:51 AM
I wish you could put more when player joins scripts in '-'
Title: Re: Scripting in dig deep
Post by: Craig on January 08, 2016, 08:25:54 AM
I wish you could put more when player joins scripts in '-'
Use the script (http://totalminerforums.net/index.php?topic=7721.msg91559#msg91559) command to call other scripts from your main PlayerJoin script.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 08, 2016, 09:09:06 AM
I use a script block to autorun on admins only when they enter the map. I used it for my new script, and it has 3 others on it aswell. It works perfectly. But it isn't very organized. Craig's way seems better for sure, and I plan to change mine up.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 13, 2016, 03:53:28 AM
I'm figuring out a lot of DD scripts. So if anyone needs help, just ask here.
Title: Re: Scripting in dig deep
Post by: Zoidberg on January 13, 2016, 04:01:29 AM

Script grinder;

   Health -1
   Loop [1000]

Script grinderend;

   Script [grinder] [cancel]

This is set to active when my hunger script hits 0. Then deactivate upon using the edible item. What am I doing wrong...

The example you posted works for me in Dig Deep. Perhaps the problem lies in the script you mentioned that is supposed to deactivate it upon using the edible item. I'd try testing the script syntax in the related scripts to see if there was just a simple mistake.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 13, 2016, 04:18:53 AM
Yeah it somehow started working... Right after that post.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 13, 2016, 07:26:33 PM
Use the script (http://totalminerforums.net/index.php?topic=7721.msg91559#msg91559) 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.
Title: Re: Scripting in dig deep
Post by: Craig 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Craig 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]
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 25, 2016, 01:14:10 AM
Well that's annoying...
Title: Re: Scripting in dig deep
Post by: Craig on January 25, 2016, 02:33:06 AM
Well that's annoying...
I put NoBBC tags around the script
Title: Re: Scripting in dig deep
Post by: Craig 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.



Title: Re: Scripting in dig deep
Post by: Craig 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?
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 26, 2016, 09:30:20 AM
I need more scriptable insanity effects. Any ideas?
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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:)
Title: Re: Scripting in dig deep
Post by: SEARCH AND CRY on January 27, 2016, 07:22:50 PM
i can solve all your problems in a few minutes with you Rev
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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...
Title: Re: Scripting in dig deep
Post by: SEARCH AND CRY on January 28, 2016, 07:00:22 PM
Here is a idea do this one script
Tint Color [player] [250,0,0]
Wait [1000]
Repeat with different colors and you can add skycolor in also
it makes the player go on a psychedelic trip
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 29, 2016, 02:34:19 AM
Here is a idea do this one script
Tint Color [player] [250,0,0]
Wait [1000]
Repeat with different colors and you can add skycolor in also
it makes the player go on a psychedelic trip

I have something similar to this in place. I like the idea of multi-phase coloring though:) I will think that over...
Title: Re: Scripting in dig deep
Post by: Craig on January 29, 2016, 03:40:40 AM
Here is a idea do this one script
Tint Color [player] [250,0,0]
Wait [1000]
Repeat with different colors and you can add skycolor in also
it makes the player go on a psychedelic trip
Please be careful not to overdo it, some people can get seizures from rapidly changing color on screens. At the very least, for each color change, try to minimize the amount of hue change. i.e. make the color changes gradual rather than sudden.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 29, 2016, 06:27:18 AM
Please be careful not to overdo it, some people can get seizures from rapidly changing color on screens. At the very least, for each color change, try to minimize the amount of hue change. i.e. make the color changes gradual rather than sudden.

Noted. I have had experiences with that happening to an epileptic friend of mine. So I totally understand the concern, and that it is very real.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 01, 2016, 01:27:08 AM
Here is a list of verified scriptables for DD;
IsBlockLit
sky color
tint
cctv
- Health
-Mobhealth
teleport
move inventory
itemswing
History
HasHistory
IsPermission
IsAvatar
Script
Script [cancel]
OpenBlock
Loop
Wait
HasInventory
IsEquiped
All particles
Sound
Fog
Hail
Rain
MoveRegion
I hope to make a better and more complete list in the future. But hopefully this will save some people some time. I will also be listing what cannot be scripted in DD.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 01, 2016, 03:26:05 AM
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?
Title: Re: Scripting in dig deep
Post by: Craig on February 01, 2016, 04:04:22 AM
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 don't know if this is the best way, but one way is to give the player some history in their PlayerLeave script, like 'History [ReturningPlayer] [player]', then when they are playing again you can check for that history with if HasHistory [ReturningPlayer] [player]'
Title: Re: Scripting in dig deep
Post by: Stoneart on February 01, 2016, 02:53:39 PM
Craig is right. You need player specific history markers throughout your game to tell the game upon player start where the person is. Also I think you can run clan specific functions as well. So you can say everyone who spawns in gets the starting clan. If you have questions you cam pm me or find me online.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 03, 2016, 01:43:56 AM
Hmm... I think I get it. I will work on it.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 03, 2016, 01:51:39 AM
Here's 1... Is it possible to move an entire building thru scripting in DD. I built a couple of things too close together. I was thinking about may he a s one move idea. I haven't even tried a MoveBlock script at all yet in DD. Let alone entire buildings. And any one that knows DD at all knows that moving block by block or completely rebuilding, is costly in both time and (in game) money.
Title: Re: Scripting in dig deep
Post by: Zoidberg on February 03, 2016, 02:03:40 AM
I believe MoveRegion still works in Dig Deep, so using that shouldn't take too much time.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 03, 2016, 02:06:44 AM
MoveRegion... That would be great! I will try it. TY
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 12, 2016, 05:43:12 AM
MoveRegion... Amazing! What a time saver. Works awesomely, but I had a problem with beds transfering properly. They would only be half there, randomly it seemed, for which side of the bed. But npc spawners transfered perfectly. Including npc, text, and textures. Going to try to move an economized shop next.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on March 11, 2016, 12:48:39 AM
MoveRegion works for economized shops! With everything intact...
Title: Re: Scripting in dig deep
Post by: Trubtavium Recordsmith VII on March 11, 2016, 02:46:50 PM
Move region made my dig deep map possible xD Already had over a million blocks placed and maybe 500k cleared from buildings alone. Imagine me clearing entire mountains by hand? Those poor sods.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on March 11, 2016, 10:52:59 PM
Yeah it is great for if you need to move an entire building too.
Title: Re: Scripting in dig deep
Post by: Trubtavium Recordsmith VII on March 12, 2016, 01:50:40 AM
Yeah it is great for if you need to move an entire building too.

Egh... Only time I tried moving a building, it disappeared... Did not save very close back either... So to this day, there is a building hidden somewhere underground on my old map.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on March 12, 2016, 02:58:38 AM
Yeah it is great for if you need to move an entire building too.

Egh... Only time I tried moving a building, it disappeared... Did not save very close back either... So to this day, there is a building hidden somewhere underground on my old map.
Ugh, that's rough! Gotta watch those coords... I have had good luck so far. Great tool for DD!
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 11, 2016, 05:02:05 AM
I have been away from the internet for some time, and recently got the 2.4 something and 2.5 updates. I couldn't help but notice a couple of my scripts no longer work. One is cctv, no swivel action anymore. Also I can't seem to use - mob health scripts. The scripts in question funtioned perfectly before the updates. So I am wondering if anything changed regarding these scripts for DD. I looked at the docs, and couldn't see any changes to how they are supposed to be written. I also tried to do a - mob health script in creative to no avail, so IDK...
Title: Re: Scripting in dig deep
Post by: Craig on September 11, 2016, 05:09:58 AM
Welcome back buddy.

They should still work. Can you post the offending CCTV and MobHealth commands?
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 11, 2016, 05:18:56 AM
Thanks:) It's good to be back! I will post them as soon as I can.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 12, 2016, 02:39:27 AM
So... - mob health magically started to work. No idea, but sweet! cctv still broken though. Tried to fix 1 of 2 easy ones. I will post them soon.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 12, 2016, 06:12:24 AM
The [O] is actually a bracketed zero, but it changes to a weird o on here.

cctv script 1 unadjusted;

CCTV [7,3031,484] [w] [0] [50]

cctv script 2 adjusted to account for swivel speed;

CCTV [281,3050,289] [w] [0] [25] [50]

Niether have the ability to swivel.
Title: Re: Scripting in dig deep
Post by: Craig on September 12, 2016, 07:46:30 AM
There is nothing wrong with your commands.

It appears swivel is bugged, and it appears there is no work around :\
Title: Re: Scripting in dig deep
Post by: CriminalDuck007 on September 12, 2016, 09:05:52 AM
Move region made my dig deep map possible xD Already had over a million blocks placed and maybe 500k cleared from buildings alone. Imagine me clearing entire mountains by hand? Those poor sods.

Im currently in a situation on of my survival worlds, that involve clearing a mountain by hand.....takes a lot of tedious and repetitive work :P
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 12, 2016, 07:54:52 PM
There is nothing wrong with your commands.

It appears swivel is bugged, and it appears there is no work around :\
That's unfortunate, but not a biggie. At least - health scripts aren't bugged.
Move region made my dig deep map possible xD Already had over a million blocks placed and maybe 500k cleared from buildings alone. Imagine me clearing entire mountains by hand? Those poor sods.

Im currently in a situation on of my survival worlds, that involve clearing a mountain by hand.....takes a lot of tedious and repetitive work :P
I believe you could use a clear region script for that. But you would lose the blocks.
Title: Re: Scripting in dig deep
Post by: Lord Leo on September 12, 2016, 08:38:08 PM
That makes sense. I will have to do some tweaking of the survival scripts to slow down or alter the effects. Otherwise new players won't stand a chance. It can be challenging enough to get started in my map for players. I hope to also automate a lot of features in my map thru NPC quest style scripts. With an employment system, economized and itemized shops, and a unique ranking system, there is much ado. I barely get a moment while hosting. Not to mention properties for sale. I have much to learn... I thought making a lighthouse beacon was a tough script... lol. Anyway, thank you all for your insight. I am now just waiting for MS to fix the bug... Impatiently!

The problem with scripted jobs is you will need to provide the pay for every player who joins. You would basically need a chest that is scripted to refill from another chest when empty, and then it transfers money to players per pay period
Doing so you will need to have a way of making money like taxes normally what i do in survival cities like that i economize the shops sell items for 1.5x-2x the price so you have easy profit
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on September 15, 2016, 12:29:45 AM
I economized also, but for selling items. Because I'm in DD, I don't want to sell most of what my shops bring in. So I adjust the amount you get for selling to 25%. Then I can either resell for 25% profit or use the stuff for expansion. It works great. Most of the 'buy' prices are unchanged.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on October 06, 2016, 05:23:06 AM
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.
Title: Re: Scripting in dig deep
Post by: Craig on October 06, 2016, 05:42:20 AM
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.
Why do you need to run a script based on a gamertag?

Can you imagine the script?

if
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
   IsGamertag [xxx]
then
  do something
elseif
etc
Title: Re: Scripting in dig deep
Post by: Stoneart 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.]
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Craig 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
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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:)
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on October 09, 2016, 11:54:58 PM
Can anyone tell me what time night falls in DD, in relation to IsClock?
Title: Re: Scripting in dig deep
Post by: .ok 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
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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.
Title: Re: Scripting in dig deep
Post by: Craig 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
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw 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!
Title: Re: Scripting in dig deep
Post by: Dryym on October 10, 2016, 07:32:05 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!

Keep in mind that if you want game minutes to be displayed properly, You'll need to do

Var [Time] = [clock:]
Var [Min] = [Time] % [1]
Var [Min] = [Min] * [100] / [1.6666]
SetText [x,y,z] [[Time:0]:[Min:0]]


You can divide by 1.66 if you have no plans of using game seconds.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on October 10, 2016, 09:49:33 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!

Keep in mind that if you want game minutes to be displayed properly, You'll need to do

Var [Time] = [clock:]
Var [Min] = [Time] % [1]
Var [Min] = [Min] * [100] / [1.6666]
SetText [x,y,z] [[Time:0]:[Min:0]]


You can divide by 1.66 if you have no plans of using game seconds.
Yeah. I noticed it counting in .100's. I'll make the adjustment. Totally cool script!
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on October 10, 2016, 10:14:14 PM
It's displaying time properly. But it changes hour at 30 seconds, not 60. Also doesn't read 01, 02, 03 minutes etc. Just says 1, 2, 3, ... 10, 11.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on October 19, 2016, 03:22:36 AM
Some people believe scripting cannot be done in DD. This is untrue! You have only to find the script block blueprint.  Or possibly get a script block from a mob drop. Then, script away!
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 19, 2018, 09:03:44 PM
Does anyone know how to script a history gain for 'punching' water?
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 25, 2018, 03:30:38 PM
... See above...
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on January 26, 2018, 02:10:53 PM
Here is an awesome script, not sure who originated it. It was handed down to me. I renamed and expanded it for my purposes.

Script 1, Mark.

If
HasHistory [mana] [player] [>=] [50]
Then
History [tp\x] [player] [delete]
History [tp\y] [player] [delete]
History [tp\z] [player] [delete]
Var
Var [y] = [pos:x]
Var [z] = [pos:x]
History [tp\x] [player]
History [tp\y] [player] [y]
History [tp\z] [player] [z]
Script [particle\teleswitch2]
History [mana] [-50]
Notify [A magical mark has been placed.] [local] [0,0,0]
Else
Notify [You don't have enough mana.] [local] [0,0,0]
End if

Script 2, Recall.

If
HasHistory [mana] [player] [>=] [50]
Then
Var
Var [y] = [history:tp\y]
Var [z] = [history:tp\z]
Script [particle\teleswitch2]
History [mana] [player] [-50]
Teleport [player] [x,y,z]
Notify [You return to your magical mark.] [local] [0,0,0]
Else
Notify [You need more mana.] [local] [0,0,0]
End If

That's it...

Edit; this script is screwed up by the forum text changing stuff. What ever it's called... IDK.
Title: Re: Scripting in dig deep
Post by: Rev Elevenclaw on February 09, 2018, 05:59:36 PM
Does giving a player a HUD bar, fill said bar?