Create account / Log in

Random layer on placement

Issues with the Vassal engine.

Moderators: Tim M, uckelman

Random layer on placement

Postby Dark Scipio » February 5th, 2008, 7:04 pm

Is it possible to place a random layer on placement?

So that one of the levels is random selected on placement.
http://www.diewaldseite.de
http://www.therainforestsite.com
Help the rainforest with a free click.
User avatar
Dark Scipio
 
Posts: 37
Joined: December 26th, 2007, 8:35 am

Random layer on placement

Postby Tim M » February 5th, 2008, 7:24 pm

By placement if you mean when pulled from palette and placed on a map then yes.

Use the key command to apply on piece that moves (in map properties). Give the pieces a DP and set their layers to allow randomization with a key command. Give the pieces a trigger that will change value of DP (use true/false type setup on the DP) and execute the randomize layer key. The trigger key command should match the map move applied key command and contain a filter that verifies the value of the DP (true/false). This will prevent the randomization trigger from firing again any time piece moves if the DP value does not match

Dark Scipio <messages@forums.vassalengine.org> wrote:
Is it possible to place a random layer on placement?

So that one of the levels is random selected on placement.

------------------------
http://www.diewaldseite.de
http://www.therainforestsite.com
Help the rainforest with a free click.







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org


Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby Tim M » February 5th, 2008, 10:42 pm

Demo Mod attached inside zip.

Grab piece out of the palette and place on map (as many as you like) Note that it randomizes the layer, but subsequent map movement on the board does not cause it to change
Attachments
RandomLayerPlacementDemo.zip
Demo mod with randomized layer upon initial placement from piece palette to a map
(5.92 KiB) Downloaded 306 times
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby Dark Scipio » February 6th, 2008, 2:27 pm

I am very impressed by your kindness. Thank you very very much.
http://www.diewaldseite.de
http://www.therainforestsite.com
Help the rainforest with a free click.
User avatar
Dark Scipio
 
Posts: 37
Joined: December 26th, 2007, 8:35 am

Re: Random layer on placement

Postby Ulfgdar » September 4th, 2013, 10:51 am

Sorry to revive the thread, but I have the same issue in a module I'm trying to implement in vassal 3.2.8

I downloaded the module Tim M posted and tried to recreate an item with the same properties, layers etc as the piece in the downloaded module. Unfortunately, even though Tim's module works, when I try to add a new item to do a similar thing (including all the properties and such) it does not work.

Trying the random keypress manually, works but i would like to make an auto randomizer. Is there something I do wrong, or is it due to vassal version. any ideas? I wish i could copy items from module to module.
Ulfgdar
 
Posts: 3
Joined: January 10th, 2013, 12:30 am

Re: Random layer on placement

Postby Tim M » September 4th, 2013, 11:14 am

Did you set up your map properties correctly also? Having the piece right is not enough
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Random layer on placement

Postby Ulfgdar » September 4th, 2013, 11:23 am

I even tried adding a new item in the module from RandomLayerPlacementDemo.zip. So i guess the map options are no problem since they were configured. Unless there some steps, to relate new pieces with the map options.
I tried checking the map tree one item at the time but nothing apart from the default seems to be there. Still new to the hole trigger thing.

As a side note, if i edit the original demo piece it still works, but new pieces do not.
Ulfgdar
 
Posts: 3
Joined: January 10th, 2013, 12:30 am

Re: Random layer on placement

Postby Tim M » September 4th, 2013, 12:32 pm

Ulfgdar wrote:I even tried adding a new item in the module from RandomLayerPlacementDemo.zip. So i guess the map options are no problem since they were configured. Unless there some steps, to relate new pieces with the map options.
I tried checking the map tree one item at the time but nothing apart from the default seems to be there. Still new to the hole trigger thing.

As a side note, if i edit the original demo piece it still works, but new pieces do not.


Looks like a old vs new property expression problem. Do everything exactly as the demo is setup except in your piece's trigger action trait replace the expression RandomValue = false with {RandomValue=="false"}

Works for me after doing that on new pieces
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Random layer on placement

Postby Ulfgdar » September 4th, 2013, 2:37 pm

I used the expression builder before which might be problematic. I entered the expression manually and it worked.

Thank you for the help!
Ulfgdar
 
Posts: 3
Joined: January 10th, 2013, 12:30 am


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 0 guests