VariableTriggers

Make your own plugin like features and more using VariableTriggers
This is a very powerful plugin that has unlimited potential. Create triggers that run lines of script when a player Clicks or Walks on a block (dirt, door, switch, trigger, torch, any block) or Create Event Triggers such as PlayerDeath , EntityDeath, BlockBreak, BlockPlaced, Join, Quit, Respawn, Interact and EntitySpawn that also run scripts. You can define Area Triggers and Command Triggers as well. You can use Dynamic Object variables and conditional IF and ELSE statements in the scripts. You can run any command that a player or OP can run and many speacial built-in commands to Teleport, Spawn Entities, Play Effects Visual or Sound, Set Blocks, Toggle Blocks, Check Players Heath and much more!. The scripts are executed on their own threads to take the strain off of the main server thread.
















-
View User Profile
-
Send Message
Posted Aug 31, 2014@AncientTom
Im guessing you accidently look over at the last bit of my reply :P
Instead of:
- '@PLAYER Sign text = <signtext:$doors.SignX,$doors.SignY,$Doors.SignZ:3>'
You'd have:
- '@SETSTR $doors.SignCord $doors.SignX'
- '@ADDSTR $doors.SignCord ,'
- '@ADDSTR $doors.SignCord $doors.SignY'
- '@ADDSTR $doors.SignCord ,'
- '@ADDSTR $doors.SignCord $doors.SignZ'
- '@PLAYER Sign text = <signtext:<var:$doors.SignCord>:3>'
You may not need the <var:> surrounding the $doors.SignCord but give it a go :)
-
View User Profile
-
Send Message
Posted Aug 31, 2014@JoelMinister
I can't begin to tell you how much I appreciate your help on this. Right now, I am feeling a little stupid. I've tried setting strings to integers several times before and got error messages in the console. I just ran a test using just numbers in the string as your example shows and it does work. I even asked for this capability a few days ago and got a negative response. This solves one problem of mine, how to re-typecast to integers.
My big problem now is to get <signtext::> to work with coordinate variables. I have tried every syntax variation I can think of but the following command line renders the operand string and not the sign text.
@PLAYER Sign text = <signtext:$doors.SignX,$doors.SignY,$Doors.SignZ:3>
-
View User Profile
-
Send Message
Posted Aug 31, 2014@AncientTom
What I've found out is that you can use SETINT to transfer strings that contains just numbers into integers, so for this you could do:
- '@SETINT $<playername>.cordx $<playername>.cordx'
- '@SETINT $<playername>.cordy $<playername>.cordy'
- '@SETINT $<playername>.cordz $<playername>.cordz'
- '@DELVAR s $<playername>.cordx'
- '@DELVAR s $<playername>.cordy'
- '@DELVAR s $<playername>.cordz'
I don't know if you're aware of this, but you can have variables of the same name if the type of Variable is different, so here we had a string and integer Variable under the same name - so now if you want to use the numbers we need to delete the string variables otherwise it will try add the strings together and we don't want this.
For then returing these numbers to co-ordinates we can do:
- '@SETSTR $<playername>.coordinate $<playername>.cordx'
- '@ADDSTR $<playername>.coordinate ,'
- '@ADDSTR $<playername>.coordinate $<playername>.cordy'
- '@ADDSTR $<playername>.coordinate ,'
- '@ADDSTR $<playername>.coordinate $<playername>.cordx'
Now the variable $<playername>.coordinate will display x,y,z :)
-
View User Profile
-
Send Message
Posted Aug 30, 2014@JoelMinister
Thank you so much for this. I have already created a script similar to this but mine was for cleaning up the junk on the end of what <relativeloc::> puts out. See my post of this. The problem is that no mater what you do along this line, you are still stuck with strings and what I need is integers and there is no re-typecasting capability with VT. The placeholder that I am trying to get working is <signtext::>. I am, however, having a second problem with the inadequacies of how VT works together within it's own environment. <signtext::> requires three comma separated integers for the sign coordinate without any spaces. I have tried using three integer variables separated by commas. The only way I can get these variables' numbers and not the variable name from within <signtext::> is to wrap them with <var:> but I need to put a space preceding the '<' of the <var:> placeholder for this to work. The other problem with this is that you cannot nest a functional placeholder within a functional placeholder which is what this is doing, so the sign still doesn't get read even though I have numbers now. In short, there is no way to use variable coordinates within <signtext::> that I can find and this makes <signtext::> useless.
-
View User Profile
-
Send Message
Posted Aug 30, 2014@AncientTom
I had the same problem about not being able to get the seperate co-ordinates from a x,y,z so I could manipulate them how I wanted, so I developed this bit of code to seperate the different co-ordinates out:
- '@SETINT $<playername>.count 1'
- '@GETSTRLEN $<playername>.cordlen [insert co-ordinate string here]'
- '@LOOP $<playername>.cordlen'
- ' @SETSTR $<playername>.cord<var:$<playername>.count> <getchar:[insert co-ordinate string here]:$<playername>.count>'
- ' @IF si $<playername>.cord<var:$<playername>.count> = ,'
- ' @IF si $<playername>.cord = x'
- ' @SETSTR $<playername>.cord y'
- ' @ELSE'
- ' @IF si $<playername>.cord = y'
- ' @SETSTR $<playername>.cord z'
- ' @ENDIF'
- ' @ENDIF'
- ' @ELSE'
- ' @IF si $<playername>.cord<var:$<playername>.count> = null'
- ' @ELSE'
- ' @ADDSTR $<playername>.cord<var:$<playername>.cord> $<playername>.cord<var:$<playername>.count>'
- ' @ENDIF'
- ' @ENDIF'
- ' @ADDINT $<playername>.count 1'
- '@ENDLOOP'
This uses the <getchar:> placeholder to go through the co-oridnates you give and records the values given until it finds the comma seperating them, which it then will record the next numbers as the next co-ordinate. The 3 Co-Ordinates will be saved in $<playername>.cordx $<playername>.cordy and $<playername>.cordz
-
View User Profile
-
Send Message
Posted Aug 30, 2014@Lyoko_Firelyte
I just loked at a post in the VT forum by Real_Melonballer who is using a string as the coordinates in <distance::>.
Would it be possible to make <signtext::> work with string coords also.
Thanks.
BY the way, let me thank you again for /vt savevars. It is a real helpful tool. It would be also nice to have /vt reloadvars.
-
View User Profile
-
Send Message
Posted Aug 30, 2014@Lyoko_Firelyte
"All $ variables are global so you can set what you need to a variable and use it..."
Thanks for this. I never in the world would have thought to set a variable within the trigger itself. It works just fine.
"Signs start at line 0, so line 3 is actually the 4th line you see"
Yes. I understand that. What I was trying to convey is that a coordinate string variable doesn't work as a parameter within functional placeholders that need integers. I can use the integers, -124,41,-579 directly and I get the line I want off of the sign. But, I can't figure out any other way with VT to convert coordinates to integer variables for use in <signtext:>. If there is no way to re-typecast a variable in VT and coordinates are stored as strings, then there is no way to dynamically use those functional placeholders that demand integers from within a script. If I have to hard code those coords into the script then I will have to write over 700 scripts, one for each cell door and that's just in one area.
This leaves me at a loss to figure out how to plug in integers into a placeholder when all I have to work with is strings.
As I said earlier, I am old and sometimes I miss something that may be obvious to others. If you could give me any suggestions as to how to set the coordinate parameter in a placeholder dynamically, I would be grateful.
Thank you for your kind response and as far as my loss, I am not yet sure of how much of my work is permanently lost but I'll recover.
-
View User Profile
-
Send Message
Posted Aug 30, 2014May I suggest few new comand to do with Inventories:
@SETSLOT [iteminformation]
I'm assuming for the item information if you didn't want any lore on the item you'd have to put something like 'null' to show you didn't want any Lore, because if that is not the case it would be sweet to have the layout of [iteminformation] the same as you do in the InventoryTriggers.yml of 'item: wool, meta: 5, amount: 1, name: Spawn, lore: Teleport % &a&ospawn, enchant:durability, slot: 0'
And also a command of:
@SETTITLE [titleofinventory]
Which would change the title at the top of the inventory that the player currently has open - this is possible in the current version of VT by having copies of inventories but just with different titles in the InventoryTriggers.yml and opening different ones depending on the message you want to give the player, but that is quite tedious if you want to change the title of the inventory to tell the player multiple messages. Ofcourse is the player has only their inventory open this command would display an error in the console.
-
View User Profile
-
Send Message
Posted Aug 30, 2014@AncientTom
All $ variables are global so you can set what you need to a variable and use it in whatever script you want to.
@AncientTom
You can't call VT commands because they aren't really commands
@AncientTom
Signs start at line 0, so line 3 is actually the 4th line you see
@AncientTom
This would be too hard & tedious from just thinking about how to code it, unless Lex wants to do it ^^
@AncientTom
I haven't modified the way VT saves & loads objects, so there's not really any advice I can give you other than hope that your backups have what you need. However, please use VT 1.3.3.1 (the latest release) as it has some really important CPU usage fixes that should make it run smoother.
-
View User Profile
-
Send Message
Posted Aug 29, 2014@AncientTom
Never mind.
I remember back about year ago when I moved my game to my dedicated server that this same thing happened. It was either the move itself or my last VT upgrade. I had to reload backups and I couldn't get VT to use my files. I'm old and my memory is fuzzy. anyway I remembered that If I shut the game service down, removed everything from the backup directory, copied my original files back into the VT directory, then I could restart the game service and VT would be forced to use my .yml files instead of starting up with the backup files and rewriting my files all over again.
For some reason beyond my comprehension, on my most recent upgrade to 1.3.3, VT chose to start with no triggers and no Object Variables and then saved this to my .yml files, overwriting all my work. Unfortunately, I have no current backups of the trigger files, so I have lost a lot of work.
Oh well ?
-
View User Profile
-
Send Message
Posted Aug 29, 2014I just noticed that I had a catastrophe happen to my VT work. My trigger.yml files have been written over with new, initialized but empty files. I am now trying to recover a lot of my work by replacing them with old backups to these files including the vardata.yml file. I've tried to reload everything with autosave paused and doing a reloadscripts & reloadtriggers but that doesn't reload my variables from the vardata.yml file and when I restart the server, these files get re-initialized again, reloaded or not.
How do I get VT to permanently accept these files?
-
View User Profile
-
Send Message
Posted Aug 29, 2014I'd like to make a suggestion.
Could you set up a method of re-typecasting using the @SET... commands. Such as ' @SETINT $Obj.Integer $Obj.Str' would re-typecast the first numeric value found in the string and save it in $Obj.Int for use in dynamic placeholders that demand integer arguements as well as for other needs. '@SETSTR $Obj.String $Obj.Integer' would re-typecast an integer value as a string and save it in $Obj.String to be used for concatination.
This would be of geat value to get around typecasting problems with scripting.
Thanks.
-
View User Profile
-
Send Message
Posted Aug 29, 2014I'm having a problem with the new <signtext:> while trying to read the third line of a region [hotel] sign. I'm using a variable for the coords of the sign, <signtext:$MMDoorTrigger.SignCoords:3>. I am getting these errors in the console:
WARN]: java.lang.NumberFormatException: For input string: "$MMDoorTrigger.SignCoords"
ERROR]: [VT] Script error (or internal error) with <signtext> at line ... MMdoors:DoorTrigger.
The contents for :$MMDoorTrigger.SignCoords is "-124,41,-579". Any thoughts?
-
View User Profile
-
Send Message
Posted Aug 29, 2014Tried to create a command trigger and call it with my walk trigger like so;
/vtcmd opendoor @CALL $MMdoors.DoorTrigger
/vtw @CMD opendoor s
Still no joy.
I can run the command trigger manually, "/opendoor s", and it works. It will not run from the walk trigger's @CMD. I get "Unknown command" on the chat line.
-
View User Profile
-
Send Message
Posted Aug 29, 2014How can I pass arguements to my script from a walk trigger. I get a VT message "Wrong number of arguements" in the console. This is really needed to be able to consolidate scripts and us one for many triggers.
Would it be possible to pass extra args found to the script being called?
-
View User Profile
-
Send Message
Posted Aug 29, 2014@AncientTom
i see what you tried to do.. to intercept the chat message from command. But i think only way to intercept the message in chat is by triggering chat event with the message.
-
View User Profile
-
Send Message
Posted Aug 29, 2014@Lyoko_Firelyte
Thanks but <cmdline> is doing the same thing. It is not being replaced with the command line.
Thanks for your help but I'm abandoning this idea anyway. My idea is to MickyMouse.
-
View User Profile
-
Send Message
Posted Aug 28, 2014<cmdline> not <chatline>
-
View User Profile
-
Send Message
Posted Aug 28, 2014This is the first time for me trying to use the <chatline> placeholder and it doesn't seem to be working for me.
Displays "Info = <chatline>"
-
View User Profile
-
Send Message
Posted Aug 27, 2014@Lyoko_Firelyte
oh btw any chance of making something that makes /tellraw simpler or integrated in VT itself? i tried to crease some stuff based on /tellraw and stopped after many many hours of fiddling.