Frictional Games Forum (read-only)
RandInt ?! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: RandInt ?! (/thread-30210.html)

Pages: 1 2


RandInt ?! - Amnesiaplayer - 07-05-2015

I am trying to create some "big landscapes" where you usually play on, so I am not gonna use planes this time.
but yeah, I made a big big Landscape, I'm really happy that I made something like this,
I did a little paint on it, like red lava rock kinda things, some "path" etc, I painted it with around 5 images.
Now the real problem.
Exporting issue, I export it as a .obj
and then rescale it etc, but then, I have to apply new textures to it.
and that is not possible, since that thing is 1 mesh object, and I used around 5 images.
Is there a way to create a "Uv" kinda map from all the paint layers you painted on the object?!
I have a friend, who's a really good animator, and sculptor, but he didn't know aobut this export thing either.

Btw, is there a possibility, to automatic, create a body to the object you make, in maya?
I mean.. you know how difficult it would be for me, If I had to add body, to my landscape? xD I'm sure I have to use around 8 million bodies then lol jk.


Btw, A little side question, how does RandInt work?!
what I actually want is 3 objects, what all the 3 objects spawns on like.. .5 diffirent locations.
I searched up in the engine scripts, but I really didn't understand anything Sad


RE: MudBox Export Issue - Traggey - 07-05-2015

First of, no, there is no way of creating landscape masks for textures in HPL, you could paint the entire thing with a bunch of textures and bake them down into one texture, but that would result in terrible texture resolution, so when it comes to landscapes in HPL using only one material is the best way to go.

Also no, there is no way of creating a body for it in maya.


RE: MudBox Export Issue - Amnesiaplayer - 07-05-2015

But do you know how I can turn all of these paint "layers" into one, uv map, so I can apply it in maya, and then finally export it to hpl Tongue
Thanks Smile
Edit: Wait, if I copy the landscape, and paste it and put it 0.0001 lower, then the orginal, and add another material, and then in hpl2 engine, can't I turn that material in body? Sad
Wouldn't that be AWESOME!


RE: MudBox Export Issue - Traggey - 07-05-2015

Yes, you preform a diffuse channel bake from the painted mesh to an indentical copy with a proper squared out UV.

However as I stated before, it will look terrible unless you use HUGE texture sizes, which simply will not work. So that is not a method you should even consider trying.

And no, you can not do that, you'll need to add the body manualy.


RE: MudBox Export Issue - Amnesiaplayer - 07-05-2015

Thanks, I think I have an idea for this, I can just simply make the landscape, and then add a texture for the whole thing, and then select some faces, and make that "Seperate" and use another textures for the "path"
Btw, do you know aboutthe RandInt??


RE: MudBox Export Issue - Traggey - 07-05-2015

I have no idea what that is, no.

And yes, you could do that, however keep in mind that this would cause terrible looking edges between your different materials, sharp edges etc etc, which is not pleasant to look at.


RE: MudBox Export Issue - Amnesiaplayer - 07-05-2015

(07-05-2015, 10:06 PM)Traggey Wrote: I have no idea what that is, no.

And yes, you could do that, however keep in mind that this would cause terrible looking edges between your different materials, sharp edges etc etc, which is not pleasant to look at.

Yes, I am going to try a lot of diffirent things, hoping for the best Tongue
edit: Never mind. I give up.
tried so many things, it won't result good.
Now I have to stay with planes Sad


RE: MudBox Export Issue - Daemian - 07-06-2015

PHP Code:
int RandInt(int alMinint alMax); 
It generates a random number between alMin and alMax

Quote:int n = RandInt(0,10);
n gets a number between 0 and 10.

You can use it for many things, like to obtain a chance to do something.

Quote:int n = RandInt(0,10);
if (n==0) { GameOver = false; }



RE: MudBox Export Issue - Amnesiaplayer - 07-06-2015

(07-06-2015, 01:38 PM)Daemian Wrote:
PHP Code:
int RandInt(int alMinint alMax); 
It generates a random number between alMin and alMax

Quote:int n = RandInt(0,10);
n gets a number between 0 and 10.

You can use it for many things, like to obtain a chance to do something.

Quote:int n = RandInt(0,10);
if (n==0) { GameOver = false; }

Oh thanks,
but if I want like, you spawn in your house and there are 3 pieces, parts.
and there are 2 locations of all the 3 parts, can I make this happen with randint?!
Like part 1, 50% at loc1, 50% at loc2, part 2 50%loc3, 50%loc4, and part 3 50% loc5, and 50%loc6 etc...
Because in the map where I need that, there are some things you have to do, if you die, you have to start over, so it would make it better if the chances are random, or otherwise it would be too easy for them to beat the parts they already did..


RE: RandInt ?! - Daemian - 07-07-2015

Having: Area1, Area2, Area3... 5:

PHP Code:
int n RandInt(1,5);
TeleportPlayer"Area"+); 

That basic idea can be applied to similar situations like you mention.

Note: To teleport the player, the area must be a StartLocation type.

Or use SetPlayerPos