Currently in Generation:4001 you lay a piece of road down. Here is what is does:
1) It detects what location the player placed it.
2) It works out whether the spot exists (so has it been placed on the map?)
3) It sees what number that area it is.
Each tile on the map has a number. For this example, 1 will be grass, 2 will be a piece of road and 3 will be an obstacle.
4) If the area number is 1, it will place the road. If it equals 2 or 3, it will say "cannot place".
Now if you want a long piece of road, you have to place it on every individual tile. I need it to allow the player to drag the road tile along a line, preferably following the structure mentioned above.
Offline
anyone? i need a script for laying and dragging roads.
Offline
hmm maybe you can use
when gf clicked
set(_counter_manager v) to [1]
set(_counter2 v)to [2]
set(_counter3 v)to [3]
Forever
Go to [mouse-pointer v]
set (x v) to (x position)
set (y v) to (y position)
add (x) to [X-position v]
add (y) to [y-position v]
if (Mouse down?)
go to x:(item(set_counter_manager) of [X-position v]) y:(item(set_counter2) of [Y-Position v]
stamp
if <<(item(set_counter3) of (x-position)=[0]> or < (item(set_counter3) of [x-position v]>[0] >
change (_counter_manager) by [1]
else
if <<(item(set_counter3) of [x-position v]=[-1]> or <(item(set_counter3) of [x-position v] <[0]>
change (_counter_manager) by [-1]
if <<(y-position)=[0] >< or >[0] >>
change set_counter2 by [1]
else
if (item(set_counter3) of [y-position v]=-1 or (item(set_counter3) of [y-position v] <0
change (set_counter2) by [-1]
change (set counter) 3 by [1]
else
if z key pressed
delete (all v) of [X-position v]
delete (all v) of [Y-position v]
(couldn't get the sratchblocks right since it kept cutting some parts out :? ) Hope this helps you in some way ! or gives you some idea
Offline
could you re-write it but with notes? I really am confused by it
Offline
Zarule6 wrote:
hmm maybe you can use
when gf clicked
set(_counter_manager v) to [1] //this is used to determine all of the values if I remember correctly useing the diffrent variables to manage the lists to know the order in which to stamp etc.
set(_counter2 v)to [2]
set(_counter3 v)to [3]
if G key pressed //command used to say you want to place the road
switch to costume dirt,tar etc. //type of road you want(material)
Forever
Go to [mouse-pointer v]
set (x v) to (x position) //this will keep tab of the position and update it automatically
set (y v) to (y position)
add (x) to [X-position v] //this will add the position to the stamping line which the user wants
add (y) to [y-position v]
if (Mouse down?) //this is the action to give the command to start stamping the road etc.
go to x:(item(set_counter_manager)) of [X-position v]) y:(item(set_counter2)) of [Y-Position v] //data being proccessed for the stamping order,calculations being made of which is to be stamped and where etc/
stamp
if <<(item(set_counter3) of (x-position)=[0]> or < (item(set_counter3) of [x-position v]>[0] >
change (_counter_manager) by [1]
else
if <<(item(set_counter3) of [x-position v]=[-1]> or <(item(set_counter3) of [x-position v] <[0]>
change (_counter_manager v) by [-1]
if <<(y-position)=[0] >< or >[0] >>
change (set_counter2 v) by [1]
else
if (item(set_counter3) of [y-position v]=-1 or (item(set_counter3) of [y-position v] <0
change (set_counter2 v) by [-1]
change (set counter3 v) by [1]
else
if z key pressed //command used to clear the road wanted.
delete (all v) of [X-position v]
delete (all v) of [Y-position v]
(couldn't get the sratchblocks right since it kept cutting some parts out :? ) Hope this helps you in some way ! or gives you some idea
Hope this helps ya out xD (yet again I fail to turn the code into scracthblocks so sad v.v )
If you want I can make an example of the code in scratch and upload it or send it to ya via skype ?
Offline
Zarule6 wrote:
Zarule6 wrote:
hmm maybe you can use
when gf clicked
set(_counter_manager v) to [1] //this is used to determine all of the values if I remember correctly useing the diffrent variables to manage the lists to know the order in which to stamp etc.
set(_counter2 v)to [2]
set(_counter3 v)to [3]
if G key pressed //command used to say you want to place the road
switch to costume dirt,tar etc. //type of road you want(material)
Forever
Go to [mouse-pointer v]
set (x v) to (x position) //this will keep tab of the position and update it automatically
set (y v) to (y position)
add (x) to [X-position v] //this will add the position to the stamping line which the user wants
add (y) to [y-position v]
if (Mouse down?) //this is the action to give the command to start stamping the road etc.
go to x:(item(set_counter_manager)) of [X-position v]) y:(item(set_counter2)) of [Y-Position v] //data being proccessed for the stamping order,calculations being made of which is to be stamped and where etc/
stamp
if <<(item(set_counter3) of (x-position)=[0]> or < (item(set_counter3) of [x-position v]>[0] >
change (_counter_manager) by [1]
else
if <<(item(set_counter3) of [x-position v]=[-1]> or <(item(set_counter3) of [x-position v] <[0]>
change (_counter_manager v) by [-1]
if <<(y-position)=[0] >< or >[0] >>
change (set_counter2 v) by [1]
else
if (item(set_counter3) of [y-position v]=-1 or (item(set_counter3) of [y-position v] <0
change (set_counter2 v) by [-1]
change (set counter3 v) by [1]
else
if z key pressed //command used to clear the road wanted.
delete (all v) of [X-position v]
delete (all v) of [Y-position v]
(couldn't get the sratchblocks right since it kept cutting some parts out :? ) Hope this helps you in some way ! or gives you some ideaHope this helps ya out xD (yet again I fail to turn the code into scracthblocks so sad v.v )
If you want I can make an example of the code in scratch and upload it or send it to ya via skype ?
nah you've done enough, I'll can pretty much use this now! thanks!
Offline