FoliageFactory
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
FoliageFactory
Hi!
It's my first script, and it works. It summons foliages within it's CollisionRadius. Useful for outdoor maps.
Previews:
It's my first script, and it works. It summons foliages within it's CollisionRadius. Useful for outdoor maps.
Previews:
You do not have the required permissions to view the files attached to this post.
- chin.democ.
- chinny!
- Posts: 2823
- Joined: 10 Aug 2006, 17:19
- Location: London
Re: FoliageFactory
So foliage appears in a circle around you? If so this could be very useful.
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
Re: FoliageFactory
It's a simple generator, the foliage appears around the FoliageFactory
Re: FoliageFactory
Awesome.
I had a go at the real thing ages ago though, never finished it.. This would be the best illusion.. latest game(s) use these aswell..
This isn't exactly that though, It wouldn't keep repeating if I'm getting you correctly.. It would only summon per map actor you place on the area...
I had a go at the real thing ages ago though, never finished it.. This would be the best illusion.. latest game(s) use these aswell..
This isn't exactly that though, It wouldn't keep repeating if I'm getting you correctly.. It would only summon per map actor you place on the area...
Last edited by ~DJ~ on 26 Jul 2011, 14:18, edited 1 time in total.
That Resident Evil Mod
————
————
~][FGS][Nobody~ wrote:DONT SEARCH WORDS ON GOOGLE WITHOUT TINKING
~[FGS]SaSQuATcH~ wrote:you+serious=error
chin.democ. wrote:It's just what you're doing with your right hand that worries me....
- chin.democ.
- chinny!
- Posts: 2823
- Joined: 10 Aug 2006, 17:19
- Location: London
Re: FoliageFactory
Oh I see, so it's a handy time saver when doing outdoor areas.
- ~][FGS][Nobody~
- Illuminated
- Posts: 5348
- Joined: 26 Oct 2005, 16:59
- Location: Schland!
Re: FoliageFactory
This is a simple but actually groundbreaking idea.
That way a map wouldn't always have the same look and perhaps it could even effect the gameplay.
Just imagine extending that ideas to decorative elements like crates. One single map would give slighty different conditions on every match.
That way a map wouldn't always have the same look and perhaps it could even effect the gameplay.
Just imagine extending that ideas to decorative elements like crates. One single map would give slighty different conditions on every match.
Nobody is perfect...
-----------------------
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
-----------------------
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with.
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
Re: FoliageFactory
In the UDK, there is a volume called FoliageFactory. I tried to make that class for Deus Ex.
- chin.democ.
- chinny!
- Posts: 2823
- Joined: 10 Aug 2006, 17:19
- Location: London
Re: FoliageFactory
How does the foliage spawn, is it all at once, is it in random locations?
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
Re: FoliageFactory
Yeah, it spawns in random locations and all at once, but it can't spawn more than 1000.
-
- Posts: 3604
- Joined: 04 Jun 2008, 12:21
- Contact:
Re: FoliageFactory
Is it based on the 'spawnmass' command?
- chin.democ.
- chinny!
- Posts: 2823
- Joined: 10 Aug 2006, 17:19
- Location: London
Re: FoliageFactory
So Nobody is right in saying you could have a different looking map every time it loads, now that is cool, I wonder what else it could be used for? crates is interesting, but I'm sure there's more interesting things to spawn too.
- ~][FGS][Nobody~
- Illuminated
- Posts: 5348
- Joined: 26 Oct 2005, 16:59
- Location: Schland!
Re: FoliageFactory
Well, continuing that thought.. more interesting objects would be a kind of predefined object combinations, like stacked crates.. or stuff like emps behind or below some spawned object!
Apart of all that creative ideas..
A pretty big issue would be the conception of a proper algorithm that defines and also enforces some rules about: where what kind of objects could be placed and where they are misplaced.
Apart of all that creative ideas..
A pretty big issue would be the conception of a proper algorithm that defines and also enforces some rules about: where what kind of objects could be placed and where they are misplaced.
Nobody is perfect...
-----------------------
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
-----------------------
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with.
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
Re: FoliageFactory
Here is the code:
FoliageFactory:
FoliageProxy:
It spawns a lot of FoliageProxy, then it changes it's mesh and texture. But I think it can spawns any type of decoration.
FoliageFactory:
Code: Select all
class FoliageFactory expands Effects;
var(Foliage) int NumberOfFoliage;
var(Foliage) Mesh FoliageMesh;
var(Foliage) Texture FoliageTexture[4];
var FoliageProxy proxy;
function PostBeginPlay()
{
local int i;
local float distance;
local rotator r;
local vector loc;
local int direction;
Super.PostBeginPlay();
do
{
direction=Rand(65535);
distance=FRand()*CollisionRadius;
r=RotRand();
r.Pitch=0;
r.Roll=0;
loc=Location+(Vector(r)*distance);
proxy = Spawn(Class 'FoliageProxy', Self,,loc, r);
if (proxy != None)
if (proxy.Mesh != FoliageMesh)
SetProxyData();
i=i+1;
} until ( i == NumberOfFoliage );
}
simulated function SetProxyData()
{
local int i;
i = Rand(41);
if (proxy != None)
{
if (FoliageMesh != None)
proxy.Mesh = FoliageMesh;
if (i== 0 && i<11)
{
proxy.MultiSkins[0] = FoliageTexture[0];
}
else if (i>10 && i<21)
{
proxy.MultiSkins[0] = FoliageTexture[1];
}
else if (i>20 && i<31)
{
proxy.MultiSkins[0] = FoliageTexture[2];
}
else if (i>30 && i<41)
{
proxy.MultiSkins[0] = FoliageTexture[3];
}
}
}
defaultproperties
{
NumberOfFoliage=1
bHidden=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
CollisionRadius=256.000000
CollisionHeight=32.000000
bCollideActors=True
}
Code: Select all
class FoliageProxy expands ParticleProxy;
defaultproperties
{
Physics=PHYS_Falling
DrawType=DT_Mesh
Style=STY_Normal
Mesh=LodMesh'DeusExDeco.Basket' <-----LOL, I forgot to change back
DrawScale=1.000000
CollisionRadius=22.000000
CollisionHeight=22.000000
}
- ~][FGS][Nobody~
- Illuminated
- Posts: 5348
- Joined: 26 Oct 2005, 16:59
- Location: Schland!
Re: FoliageFactory
Yeah, I've already looked at the code within the package you provided.
Just one thing.. for the sake off efficiency, you could replacewith
Just one thing.. for the sake off efficiency, you could replace
Code: Select all
if (i== 0 && i<11)
{
proxy.MultiSkins[0] = FoliageTexture[0];
}
else if (i>10 && i<21)
{
proxy.MultiSkins[0] = FoliageTexture[1];
}
else if (i>20 && i<31)
{
proxy.MultiSkins[0] = FoliageTexture[2];
}
else if (i>30 && i<41)
{
proxy.MultiSkins[0] = FoliageTexture[3];
}
Code: Select all
proxy.MultiSkins[0]=FoliageTexture[i % ArrayCount(FoliageTexture)];
Nobody is perfect...
-----------------------
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
-----------------------
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with.
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
- [FGS]Kalman
- Throne/6G
- Posts: 931
- Joined: 20 Aug 2010, 15:52
- Location: 9th circle of hell
- Contact:
Re: FoliageFactory
Thanks, I'm just a begginer
Edit: I get this error: D:\Játékok\DeusEx\FoliageFactory\Classes\FoliageFactory.uc(49) : Error, Bad or missing expression in array index
Failed due to errors.
Edit: I get this error: D:\Játékok\DeusEx\FoliageFactory\Classes\FoliageFactory.uc(49) : Error, Bad or missing expression in array index
Failed due to errors.