FoliageFactory

Multiplayer Modifications
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

FoliageFactory

Post by [FGS]Kalman »

Hi!
It's my first script, and it works. It summons foliages within it's CollisionRadius. Useful for outdoor maps.
Previews:
Image
Image
You do not have the required permissions to view the files attached to this post.
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
chin.democ.
chinny!
chinny!
Posts: 2823
Joined: 10 Aug 2006, 17:19
Location: London

Re: FoliageFactory

Post by chin.democ. »

So foliage appears in a circle around you? If so this could be very useful.
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: FoliageFactory

Post by [FGS]Kalman »

It's a simple generator, the foliage appears around the FoliageFactory
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
~DJ~
Teh 1337'
Teh 1337'
Posts: 2608
Joined: 29 Jun 2008, 13:18

Re: FoliageFactory

Post by ~DJ~ »

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.. :-D

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....
User avatar
chin.democ.
chinny!
chinny!
Posts: 2823
Joined: 10 Aug 2006, 17:19
Location: London

Re: FoliageFactory

Post by chin.democ. »

Oh I see, so it's a handy time saver when doing outdoor areas.
User avatar
~][FGS][Nobody~
Illuminated
Illuminated
Posts: 5348
Joined: 26 Oct 2005, 16:59
Location: Schland!

Re: FoliageFactory

Post by ~][FGS][Nobody~ »

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. :o
Nobody is perfect...
-----------------------
ô¿ô¥[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.
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.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: FoliageFactory

Post by [FGS]Kalman »

In the UDK, there is a volume called FoliageFactory. I tried to make that class for Deus Ex.
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
chin.democ.
chinny!
chinny!
Posts: 2823
Joined: 10 Aug 2006, 17:19
Location: London

Re: FoliageFactory

Post by chin.democ. »

How does the foliage spawn, is it all at once, is it in random locations?
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: FoliageFactory

Post by [FGS]Kalman »

Yeah, it spawns in random locations and all at once, but it can't spawn more than 1000.
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
~[FGS]SaSQuATcH~
Posts: 3604
Joined: 04 Jun 2008, 12:21
Contact:

Re: FoliageFactory

Post by ~[FGS]SaSQuATcH~ »

Is it based on the 'spawnmass' command?
User avatar
chin.democ.
chinny!
chinny!
Posts: 2823
Joined: 10 Aug 2006, 17:19
Location: London

Re: FoliageFactory

Post by chin.democ. »

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.
User avatar
~][FGS][Nobody~
Illuminated
Illuminated
Posts: 5348
Joined: 26 Oct 2005, 16:59
Location: Schland!

Re: FoliageFactory

Post by ~][FGS][Nobody~ »

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. :-k
Nobody is perfect...
-----------------------
ô¿ô¥[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.
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.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: FoliageFactory

Post by [FGS]Kalman »

Here is the code:
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
}
FoliageProxy:

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
}
It spawns a lot of FoliageProxy, then it changes it's mesh and texture. But I think it can spawns any type of decoration.
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
~][FGS][Nobody~
Illuminated
Illuminated
Posts: 5348
Joined: 26 Oct 2005, 16:59
Location: Schland!

Re: FoliageFactory

Post by ~][FGS][Nobody~ »

Yeah, I've already looked at the code within the package you provided. :oops:

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];
         }
with

Code: Select all

proxy.MultiSkins[0]=FoliageTexture[i % ArrayCount(FoliageTexture)];
Nobody is perfect...
-----------------------
ô¿ô¥[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.
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.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: FoliageFactory

Post by [FGS]Kalman »

Thanks, I'm just a begginer :D
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.
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
Post Reply