The only method I know of is to compile the features within mapconv and set rotation to -1. This works, but I was really hoping to avoid compiling features in for my next map and applying them via lua. Is there a better way to do this?
EDIT: -1 not -0
Applying random rotation to features
Moderator: Moderators
Applying random rotation to features
Last edited by The Yak on 12 Aug 2015, 18:21, edited 1 time in total.
Re: Applying random rotation to features
Code: Select all
if ( FeatureDefs[FID].customParams.randomrotate ) then
Spring.SetFeatureDirection(featureID, math.random(-1,1), 1, math.random(-1,1))
end
Re: Applying random rotation to features
Just a minor correction: -1, and not -0.The Yak wrote:The only method I know of is to compile the features within mapconv and set rotation to -0. This works, but I was really hoping to avoid compiling features in for my next map and applying them via lua. Is there a better way to do this?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Applying random rotation to features
I only made feature place standalone, it is entirely Smith's work.PicassoCT wrote:From Forb s Feature placer? You need to set randomrotate in customParamCode: Select all
if ( FeatureDefs[FID].customParams.randomrotate ) then Spring.SetFeatureDirection(featureID, math.random(-1,1), 1, math.random(-1,1)) end
Re: Applying random rotation to features
All i ever wanted, is to see you two fight to the death.. is that asked too much. Cant you just take credit and run with it?
Re: Applying random rotation to features
>Search spring wiki for customParamPicassoCT wrote:From Forb s Feature placer? You need to set randomrotate in customParamCode: Select all
if ( FeatureDefs[FID].customParams.randomrotate ) then Spring.SetFeatureDirection(featureID, math.random(-1,1), 1, math.random(-1,1)) end
-No Results
>Search FP_featureplacer.lua for customParam
-No Results
Can we dumb down the explanation here? I don't know what I'm supposed to do with this information.
Or am I supposed to be adding that code snippet to FP_featureplacer?
My features are already set to -1rotation and they definitely aren't random.
Re: Applying random rotation to features
you write a Table called customParams into the FeatureDef
Code: Select all
...
customParams={
randomrotate =true
}
...
Re: Applying random rotation to features
This isn't for use in mapconv
the custom param is for a deeper setting in the random rotation.
Mapconv doesn't DO rand rotation with that param. You can write some gadget to read all features, remove them and replace them randomly if you want.
What I am assuming you want is something like the random rotation feature in feature placer which was when you placed a feature you enabled this setting and the feature could rotate cardinal(n,s,e,w) or actually random. ANY CUSTOM PARAM is not part of spring but part of another lua.
Give me a clearly defined requirement and I could probably shart this out in an hour(time given for testing) for you.
the custom param is for a deeper setting in the random rotation.
Mapconv doesn't DO rand rotation with that param. You can write some gadget to read all features, remove them and replace them randomly if you want.
What I am assuming you want is something like the random rotation feature in feature placer which was when you placed a feature you enabled this setting and the feature could rotate cardinal(n,s,e,w) or actually random. ANY CUSTOM PARAM is not part of spring but part of another lua.
Give me a clearly defined requirement and I could probably shart this out in an hour(time given for testing) for you.
Re: Applying random rotation to features
That sounds great smoth. I'm going to make an initial release first once springfiles returns to life. I'll be in touch about what I exactly want later.
Re: Applying random rotation to features
Cool, I'll be here