early dev builds

mcmonkey

Administrator
Staff member
Helper
What's that? A NEW BUILD YOU SAY?

Fixes, more fixes, some fixes, also fixes.
"addto list" command. Cuboid tags. Teleport command. Some tags and such. Entity friendly names. Setblock += list(location).
 

mcmonkey

Administrator
Staff member
Helper
Another new build today!

Fixes, fixes, get your fixes...
In-game 'command' scripts!
various tags
ItemTag is a new tag type.
Give command.
More fixes.

Here's a proof-of-concept / sample script:

Denizen 2 World Editor! With three whole commands!

Code:
# +-----------------------
# | Denizen 2 World Editor
# +-----------------------
#
# Commands:
# /.wand
# /.set [new block-type]
# /.replace [old block-type] [new block-type]
#

# /wand command
d2we_command_wand:
    type: command
    debug: minimal
    name:
    - wand
    - .wand
    permission: d2we.admin.wand
    description: Gives you the D2WE wand.
    script:
    # TODO: Neater method to apply flags!
    - give <player> minecraft:blaze_rod/1/denizen&coflagmap:d2we_iswand&cotrue|display_name:<texts.for_input[color:aqua|text:D2WE-Wand]>
    - tell <player> "<texts.for_input[color:green|text:Wand given. Left click to start a selection, right click to expand it!]>"

# wand clicky buttons
d2we_world_wand:
    type: world
    debug: minimal
    events:
        on player breaks block:
        - if <player.held_item.has_flag[d2we_iswand]>:
          - flagentity <player> d2we_selection:<server.cuboid_wrapping[<context.[location]>]>
          # TODO: colors, effects, etc.
          - tell <player> "<texts.for_input[color:aqua|text:Selection started at <context.[location]>.]>"
          - determine cancelled true
        on player right clicks block:
        - if <player.held_item.has_flag[d2we_iswand]> && <player.has_flag[d2we_selection]> && !<cuboid[<player.flag[d2we_selection]>].contains[<context.[location]>]>:
          - flagentity <player> d2we_selection:<server.cuboid_wrapping[<cuboid[<player.flag[d2we_selection]>].min>|<cuboid[<player.flag[d2we_selection]>].max>|<context.[location]>]>
          # TODO: colors, effects, etc.
          - tell <player> "<texts.for_input[color:aqua|text:Selection expanded to include <context.[location]>.]>"
          - determine cancelled true

# Inject this to ensure the player's selection is available
d2we_injectable_reqsel:
    type: task
    debug: minimal
    script:
    - if !<player.has_flag[d2we_selection]>:
      - tell <player> "<texts.for_input[color:red|text:You do not have anything selected!]>"
      - stop

# /set command
d2we_command_set:
    type: command
    debug: minimal
    name:
    - set
    - .set
    permission: d2we.admin.set
    description: Sets the selected region to a specified block type.
    script:
    - if <context.[arguments].size> < 1:
      - tell <player> "<texts.for_input[color:red|text:/.set [new block-type]]>"
      - stopc
    - inject d2we_injectable_reqsel
    - define choice <context.[arguments].[1]>
    - if !<server.block_type_is_valid[<[choice]>]>:
      - tell <player> "<texts.for_input[color:red|text:That block type  (<[choice]>) doesn't make sense to me!]>"
      - stop
    - define bt <block_type[<[choice]>]>
    - define t1 <system.current_time.total_milliseconds>
    - define locs <cuboid[<player.flag[d2we_selection]>].block_locations>
    - setblock <[locs]> <def[bt]> false
    - define t2 <system.current_time.total_milliseconds>
    - tell <player> "<texts.for_input[color:aqua|text:Successfully edited <def[locs].size> blocks, in <[t2].subtract_integer[<[t1]>]> milliseconds.]>"

# /replace command
d2we_command_replace:
    type: command
    debug: minimal
    name:
    - replace
    - .replace
    permission: d2we.admin.replace
    description: Replaces all of a specified block type within a region to another block type.
    script:
    - if <context.[arguments].size> < 2:
      - tell <player> "<texts.for_input[color:red|text:/.replace [old block-type] [new block-type]]>"
      - stopc
    - inject d2we_injectable_reqsel
    - define choice <context.[arguments].[1]>
    - if !<server.block_type_is_valid[<[choice]>]>:
      - tell <player> "<texts.for_input[color:red|text:That block type (<[choice]>) doesn't make sense to me!]>"
      - stop
    - define choice2 <context.[arguments].[2]>
    - if !<server.block_type_is_valid[<[choice2]>]>:
      - tell <player> "<texts.for_input[color:red|text:That block type (<[choice2]>) doesn't make sense to me!]>"
      - stop
    - define bt_old <block_type[<[choice]>]>
    - define bt_new <block_type[<[choice2]>]>
    - define t1 <system.current_time.total_milliseconds>
    - define locs <cuboid[<player.flag[d2we_selection]>].block_locations[<[bt_old]>]>
    - setblock <[locs]> <def[bt_new]> false
    - define t2 <system.current_time.total_milliseconds>
    - tell <player> "<texts.for_input[color:aqua|text:Successfully edited <def[locs].size> blocks, in <[t2].subtract_integer[<[t1]>]> milliseconds.]>"
 

AsyD-Rabbit

New member
Oct 22, 2016
4
0
0
Woop woop :)


Edit:

mcmonkey said:
Here's a proof-of-concept / sample script:

Testing it and getting told to make a region selection first, although I have one defined.

Region: -39,65,34 - -52,65,30

Denizen2Core 0.1.2 #6
Denizen2Sponge 0.1.2 #8

MinecraftForge 12.18.1.2123
SpongeForge 6.0.0-BETA-1914
 

mcmonkey

Administrator
Staff member
Helper
AsyD-Rabbit said:
Woop woop :)


Edit:

mcmonkey said:
Here's a proof-of-concept / sample script:

Testing it and getting told to make a region selection first, although I have one defined.

Region: -39,65,34 - -52,65,30

Denizen2Core 0.1.2 #6
Denizen2Sponge 0.1.2 #8

MinecraftForge 12.18.1.2123
SpongeForge 6.0.0-BETA-1914
It's looking to me like Sponge for 1.11 (Sponge 6.0.0) is just straight borked in general :/
I literally cannot give myself the wand item. Or any item. And the code on my end is fine... Sponge is even politely reporting that it's rejecting any perfectly acceptable item :(

Would recommend testing on Sponge 1.10 until they stable out.
 

AsyD-Rabbit

New member
Oct 22, 2016
4
0
0
mcmonkey said:
It's looking to me like Sponge for 1.11 (Sponge 6.0.0) is just straight borked in general :/
I literally cannot give myself the wand item. Or any item. And the code on my end is fine... Sponge is even politely reporting that it's rejecting any perfectly acceptable item :(

Would recommend testing on Sponge 1.10 until they stable out.


Ha.
Stylish.

Thanks for the feedback. Will backstep a version then.
 

mcmonkey

Administrator
Staff member
Helper
Latest dev build of SpongeForge (1974) seems to be a fair bit more functional, thanks to a relevant PR getting pulled in. Was able to get a wand and use it to set some grass to air and back again.
 

mcmonkey

Administrator
Staff member
Helper
Suddenly, a build!

Tons of tags!
Really, a lot of tags!
Give command improvements
Target SpongeAPI 6.0.0 (MC 1.11)
The every event!
Fixes for Depenizen support!
 

mcmonkey

Administrator
Staff member
Helper
Build says what?

Lots of bugfixes!
Delta Time Secondly/Minutely event!
server.worlds tag
world.entities tag
location math tags
location.nearby_entities[type] tag


SAMPLE SCRIPT!!!!!!!!!:
Code:
speed_boost_world:
    type: world
    debug: false
    events:
        on delta time secondly:
        - repeat 10:
          - wait 0.1s
          - foreach start <server.worlds> -save world:
            - foreach start <[world].entities[minecart]> -save entity:
              - if <[entity].has_flag[speedmod]> && <[entity].velocity.vector_length_squared> > 0.01:
                - editentity <[entity]> velocity:<[entity].velocity.multiply[<[entity].flag[speedmod].to_number>]>

speedmod_command:
    type: command
    name: speedmod
    description: Modifies the speed of nearby minecarts.
    permission: speed_boost.speedmod
    script:
    - if <context.[source]> != "player":
      - echo "Nope!"
      - stop
    - if <context.[arguments].size> != 1:
      - tell <player> "/speedmod [speed]"
      - stop
    - define speedmod <context.[arguments].get[1].to_number||1>
    - define ents <player.location.nearby_entities[type:minecart|range:2]>
    - foreach start <[ents]> -save entity:
      - flagentity <[entity]> speedmod:<[speedmod]>
    - tell <player> "Speedmod for <[ents].size> minecart(s)  changed to <[speedmod]>!"
 

mcmonkey

Administrator
Staff member
Helper
Buildy build mcbuilderpants

tags and such
if statements magics
meta magic
script timings
map tag cheat shorthand
sponge stuff and tags and stuff
cleaning of things
NARRATE COMMAND FOR SOME REASON
 

Anthony

Active member
Aug 5, 2016
35
0
6
mcmonkey said:
... DATA MOVED FROM assets/ TO config/ MOVE YOUR SCRIPTS...

Why? It seems like a very awkward place for it.
 

mcmonkey

Administrator
Staff member
Helper
Anthony said:
mcmonkey said:
... DATA MOVED FROM assets/ TO config/ MOVE YOUR SCRIPTS...

Why? It seems like a very awkward place for it.
Something about the way forge/sponge/etc. have chosen to work.
Ask Morphan, basically :P


Nobody seems to have any idea what assets/ is for.


If you start to think there's any logic in it, know that it's based on Mojang's layout roughly, and thus by definition cannot be logical, QED.
 

mcmonkey

Administrator
Staff member
Helper
New build you say?

Repeat/foreach have "stop" and "next" now!
Else/if functions smarter!
some more tags exist now!
Version number changes!
MORE TAGS
EVEN MORE TAGS?????!!!!
mount command
 

mcmonkey

Administrator
Staff member
Helper
Minor build today:

Fix some tags n such
Item data excessiveness
tags
flagentity removal
item without_flags
rotation via editentity (The key for rotation is a bork, so I've made my own imitation key! Exclusively usable by editentity atm)
 

mcmonkey

Administrator
Staff member
Helper
Minor build again:

"-named args" are now "--named args" with two dashes rather than one
Rotation system works in spawn command too now
flagentity is now flag/unflag
 

mcmonkey

Administrator
Staff member
Helper
Updates include some reorg and such...

Undefine command,
lots of tags,
YamlTag,
Bug fixes,
while command has be re-logiced
more bug fixes and tags
Really, a lot of random tags