A website for every gema-assaultcube fan
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 Grid / Random mapmodel scripts for coop

View previous topic View next topic Go down 
AuthorMessage
|tm|



Messages : 30
Joined/Date d'inscription : 2015-06-19

PostSubject: Grid / Random mapmodel scripts for coop   Tue Aug 18, 2015 6:44 am

GRID:

This creates a grid of map models within a selected area, spaced by the desired amount.

Usage: /modelgrid MAPMODEL SPACING [ELEVATION] [TEXTURE]

Select desired area (divisible by SPACING best), then run command.

e.g. /mapmodel 44 2

Code:
modelgrid = [ tmp_x = ((selx)) ; tmp_y = ((sely)) ; tmp_xs = (selxs) ; tmp_ys = (selys) ; if (< $tmp_xs $arg2) [ tmp_xs = $arg2 ] ; if (< $tmp_ys $arg2) [ tmp_ys = $arg2 ] ; loop i (div $tmp_xs $arg2) [ loop j (div $tmp_ys $arg2) [ select (+ $tmp_x (* $i $arg2)) (+ $tmp_y (* $j $arg2)) 1 1 ; newent mapmodel $arg1 $arg3 $arg4 ] ] ]

RANDOM:

This will place map models at random coordinates within the selected area.

Usage: /randmodels MAPMODEL QUANTITY [FUDGE] [ELEVATION] [TEXTURE]

For example, to create 200 randomly placed grass map models, select the desired area and then: /randmodels 17 200

The FUDGE argument is optional, it's so you can place groups of models rather than just one specifically, a random model between MAPMODEL and MAPMODEL+FUDGE.

For example there are six different types of grass that start from map model number 17 and go up to 22, so to create 200 randomly placed map models consisting of the all of the available grasses: /randmodels 17 200 6

Code:
randmodels = [ tmp_x = (selx) ; tmp_y = (sely) ; tmp_xs = (selxs) ; tmp_ys = (selys) ; loop i $arg2 [ select (+ (rnd $tmp_xs) $tmp_x) (+ (rnd $tmp_ys) $tmp_y) 1 1 ; newent mapmodel (+ $arg1 (rnd $arg3)) $arg4 $arg5 ] ]




Last edited by |tm| on Thu Aug 20, 2015 7:01 am; edited 3 times in total
Back to top Go down
View user profile
|HP|
Admin


Messages : 226
Joined/Date d'inscription : 2010-06-01

Gema stats
farthest jump: MAX

PostSubject: Re: Grid / Random mapmodel scripts for coop   Tue Aug 18, 2015 6:58 am

nice nice thx
Back to top Go down
View user profile
Altair



Messages : 24
Joined/Date d'inscription : 2014-02-01
Age : 22
Location/Localisation : Oman

Gema stats
farthest jump: Middle

PostSubject: Re: Grid / Random mapmodel scripts for coop   Tue Aug 18, 2015 10:08 am

nice one Very Happy
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Grid / Random mapmodel scripts for coop   Today at 9:37 am

Back to top Go down
 
Grid / Random mapmodel scripts for coop
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Random Funny Pictures
» Random titles hoo
» Your Opinion on the Random Dungeon Finder
» Something Random
» Random Chat #105

Permissions in this forum:You cannot reply to topics in this forum
gema :: International :: Scripts-
Jump to: