Author Topic:  [How to] Make Scripts  (Read 20043 times)

0 Members and 1 Guest are viewing this topic.

ANTHONY 7357

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
    • Awards
  • Xbox: ANTHONY 7357
Re: -=[How to]=- Make Scripts
« Reply #30 on: April 09, 2014, 08:57:43 AM »
Thank you so much for making this guide. I would have never figured out how to even refill a chest using scripts without it.
Hi Craig

DHGStealPackage

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
    • Awards
  • Xbox: DHGStealPackage
  • PSN: WhereThatWallAt
Re: -=[How to]=- Make Scripts
« Reply #31 on: April 09, 2014, 09:23:45 AM »
Yes I have made a couple of looping scripts, but there is a mech in place to stop recursive scripts
Source

can make simple loopers like so;

1: Script [1]
2: Commit
3: Wait [1000]
4: Script [2]
5: Commit
6: Wait [1000]
7: Script [1]
8: Commit
9: Wait [1000]
10: Script [2]
11: Commit

repeat as necessary, but there is a limit then it can't be looped by switches, buttons, scripts or anything.. will need a manual reboot if no one can find a way round it

Tried this, but didn't have "Commit". What does it do? (It didn't work obviously...) :P

Keaton Potatoes

  • Elite Member
  • *****
  • Posts: 529
  • It's always Christmas in Gotham muhahaha
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Probadcop999
Re: -=[How to]=- Make Scripts
« Reply #32 on: April 09, 2014, 09:25:21 AM »
Thanks you sooooooo much I was so lost  ::) Most helpful script guide I have seen (Granted I haven't seen very many :P)

Tom Snow

  • Global Moderator
  • Legendary Member
  • ******
  • Posts: 1373
  • "Witness me! I live, I die, I live again."
  • Awards 1 year on site+100 posts Former MotM winners 3 years on site+600 posts I AM THE LAW! 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #33 on: April 09, 2014, 09:53:19 AM »
Yes I have made a couple of looping scripts, but there is a mech in place to stop recursive scripts
Source

Spoiler for Hidden Content:
can make simple loopers like so;

1: Script [1]
2: Commit
3: Wait [1000]
4: Script [2]
5: Commit
6: Wait [1000]
7: Script [1]
8: Commit
9: Wait [1000]
10: Script [2]
11: Commit

repeat as necessary, but there is a limit then it can't be looped by switches, buttons, scripts or anything.. will need a manual reboot if no one can find a way round it

I had a feeling there was a mechanism in place to stop it, For what I was trying to do, it would have been looped infinitely and To do it I will just settle for a Manual reboot in the form of a button. Thanks for the Help thought :).


(smacks you)

being stupid is gona start to hurt around here.

muD

  • Legendary Member
  • *****
  • Posts: 1177
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members Day 1 w/25+ posts (4/12/13) 2 years on site+300 posts Former MotM winners 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #34 on: April 09, 2014, 10:02:32 AM »
No worries fellas. Remember, if there is anything in particular you wanna see, know or need help with, we'll try an help when we can. feel free to post..


Tried this, but didn't have "Commit". What does it do? (It didn't work obviously...) :P
Quote from: Craig
Commit is used to force a graphics refresh, basically allowing a primitive form of animation during the execution of the script.

If the game forced a graphics refresh after every command, the scripts would run quite slow because graphics refreshes are slow. So the game doesn't do that, it just executes all the commands and causes a graphics refresh at the end.

This would usually be the desired behaviour anyway. If you have a bunch of add block and clear block commands to build up a structure, you probably don't want to see each block being added and cleared (animation), you just want to see the final result at the end (no animation).

However if you do want to see the animation, the commit command is provided to give you that option. It would normally be used in tandem with the wait command to create a slight delay between each animation.

I used it in each step of the looping script test to make sure i could see the removal & addition of the blocks on every action.

it's more demanding but was essential for seeing every animate move of the script

Note, while that demanding looping script was running, any other script i tried to run had noticeably increased load times
« Last Edit: April 09, 2014, 10:04:54 AM by muD »

stewydeadmike

  • Elite Member
  • *****
  • Posts: 642
  • Defeating a sandwich only makes it tastier.
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: stewydead mike
  • PSN: don't have one :(
  • Steam: stewydeadmike
Re: -=[How to]=- Make Scripts
« Reply #35 on: April 09, 2014, 10:30:15 AM »
I found a problem when trying to make a sword spawn in chest but when
I tested it it said item unrecongized and didn't spawn in the chest how do I fix this  :!

Generation 0: if you're reading this copy and paste this into your sig and increase the number by one. I'm doing this for... research.

muD

  • Legendary Member
  • *****
  • Posts: 1177
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members Day 1 w/25+ posts (4/12/13) 2 years on site+300 posts Former MotM winners 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #36 on: April 09, 2014, 10:57:34 AM »
I found a problem when trying to make a sword spawn in chest but when
I tested it it said item unrecongized and didn't spawn in the chest how do I fix this  :!
I just tested & works ok
Your problem is probably a typo - Make sure to use no capital letters or spaces in the command line item or block names.

You'll need a command line for each sword you want added - probably the case for all items which don't stack..

To add 5 swords to your chest, you will need something like this;
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]

-changing the 1 has no effect it will add one sword at a time.
Make one command line then just copy it however many times needed to get the right amount of swords.
Can also double them up by setting a script block to run the script when powered On & Off

To fill a chest with swords you could copy the AddInventory command line 25 times into the script, then set a script block to run that script when a button powers On, & again when the button powers off.. = 50 swords added. Full chest.
k?

stewydeadmike

  • Elite Member
  • *****
  • Posts: 642
  • Defeating a sandwich only makes it tastier.
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: stewydead mike
  • PSN: don't have one :(
  • Steam: stewydeadmike
Re: -=[How to]=- Make Scripts
« Reply #37 on: April 09, 2014, 11:10:22 AM »
I just tested & works ok
Your problem is probably a typo - Make sure to use no capital letters or spaces in the command line item or block names.

You'll need a command line for each sword you want added - probably the case for all items which don't stack..

To add 5 swords to your chest, you will need something like this;
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]

-changing the 1 has no effect it will add one sword at a time.
Make one command line then just copy it however many times needed to get the right amount of swords.
Can also double them up by setting a script block to run the script when powered On & Off

To fill a chest with swords you could copy the AddInventory command line 25 times into the script, then set a script block to run that script when a button powers On, & again when the button powers off.. = 50 swords added. Full chest.
k?
oooooohhhhh *facepalm* I had a space in it  :P but thanks now I know I need a separate command to add all the swords

Generation 0: if you're reading this copy and paste this into your sig and increase the number by one. I'm doing this for... research.

DHGStealPackage

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
    • Awards
  • Xbox: DHGStealPackage
  • PSN: WhereThatWallAt
Re: -=[How to]=- Make Scripts
« Reply #38 on: April 09, 2014, 11:44:28 AM »
No worries fellas. Remember, if there is anything in particular you wanna see, know or need help with, we'll try an help when we can. feel free to post..


I used it in each step of the looping script test to make sure i could see the removal & addition of the blocks on every action.

it's more demanding but was essential for seeing every animate move of the script

Note, while that demanding looping script was running, any other script i tried to run had noticeably increased load times

Thank you so much! So my scripts were working i just couldn't see it?

Michaelc9

  • Member
  • ***
  • Posts: 107
  • Creator of LoP. Co-Host of Catsbury & Creditland.
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Michaelc9
Re: -=[How to]=- Make Scripts
« Reply #39 on: April 09, 2014, 05:28:52 PM »
When writing a script, I do not understand what is meant by the commands 'comment', 'commit' or 'texture'.
Everything else I understand, and I continue to develop more complicated scripts, but I'd like to know what these mean if somebody would please enlighten me.

.ok

  • Supreme Member
  • *****
  • Posts: 2211
  • Awards Site art contributions/TPs in-game/Contest winners 4 years on site+1000 posts Members who have unlocked the robotic avatar Donated a giveaway prize. (Must be a prize of cash value.) 3 years on site+600 posts 2 years on site+300 posts Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #40 on: April 09, 2014, 05:47:17 PM »
I just tested & works ok
Your problem is probably a typo - Make sure to use no capital letters or spaces in the command line item or block names.

You'll need a command line for each sword you want added - probably the case for all items which don't stack..

To add 5 swords to your chest, you will need something like this;
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]
AddInventory [coordinates] [steelsword] [1]

-changing the 1 has no effect it will add one sword at a time.
Make one command line then just copy it however many times needed to get the right amount of swords.
Can also double them up by setting a script block to run the script when powered On & Off

To fill a chest with swords you could copy the AddInventory command line 25 times into the script, then set a script block to run that script when a button powers On, & again when the button powers off.. = 50 swords added. Full chest.
k?
wrong :p
i actually used GoldPieces
and it still filled the chests




.ok

  • Supreme Member
  • *****
  • Posts: 2211
  • Awards Site art contributions/TPs in-game/Contest winners 4 years on site+1000 posts Members who have unlocked the robotic avatar Donated a giveaway prize. (Must be a prize of cash value.) 3 years on site+600 posts 2 years on site+300 posts Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #41 on: April 09, 2014, 05:48:24 PM »
mud did you check your messages?i mped you




.ok

  • Supreme Member
  • *****
  • Posts: 2211
  • Awards Site art contributions/TPs in-game/Contest winners 4 years on site+1000 posts Members who have unlocked the robotic avatar Donated a giveaway prize. (Must be a prize of cash value.) 3 years on site+600 posts 2 years on site+300 posts Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #42 on: April 09, 2014, 05:52:17 PM »
and a q i was wondering about bfr i try and out :P
 is
Is there a way to set the script to run at a specific time
and/or day/night or both

and then ive heard about ppl being able to make npc move around
how do you do that/or quests




Littleman9Mew2

  • Member
  • ***
  • Posts: 247
  • I AM MEWTWO!
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
Re: -=[How to]=- Make Scripts
« Reply #43 on: April 09, 2014, 06:50:24 PM »
buD, its me again, what is the aux command on placeblock for?

placeblock [x,y,z] [name] [aux]
Check out my Youtube channel!

P.S.
I'm baaack!

DHGStealPackage

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
    • Awards
  • Xbox: DHGStealPackage
  • PSN: WhereThatWallAt
Re: -=[How to]=- Make Scripts
« Reply #44 on: April 09, 2014, 07:12:42 PM »
buD, its me again, what is the aux command on placeblock for?

placeblock [x,y,z] [name] [aux]

[Aux] Is for when you place a directional item. This number determines how the block is placed (ex. switches on the side of blocks etc.) . for most things, its "0" but it's different for stuff like switches and such.
« Last Edit: April 09, 2014, 07:37:38 PM by DHGStealPackage »