Jump to content
Sign in to follow this  
RANKER

My country flag...

Recommended Posts

I would like to put a Canada flag in a domination map??

I would greatly appreciate if someone could explain to me

each step to fallow so I can do this for my clan.

all the very best.

Ranker

Share this post


Link to post
Share on other sites

I'm kind of new to all of this but I know at least for while I'm messing about in single player using

this setFlagTexture "flag.jpg";

Where flag.jpg is the name of an image in my missions folder that is 256x256 and this works fine.

The code is placed in the initialise section of any flag.

Edited by rawrbear
Clarification

Share this post


Link to post
Share on other sites

What he said.

If you spawn the flag with a script, make sure you set the flag texture on the server. Setting it on clients won't work.

Make sure you PBO the mission (rather than host its "editor" version, which shows in blue rather than normal in the mission selection screen), or else clients will not be able to see the proper flag texture.

Flag must be 2^nX2^m afaik. 256X256 seems to be a good resolution.

Share this post


Link to post
Share on other sites

rawrbear thank you very very much :)

galzohar

thank you, but like rawrbear I am just starting with scripting etc.

The information you are giving me are crucial, that is why I would

appreciate very much if you could, and have the time, to indicate

to me a detail procedure to follow to achieve this.

It is for our server also, and it would be a real shame if people

could not see our flag while playing.

Very kind of you to warn me about this.

thank you very much

Ranker

Share this post


Link to post
Share on other sites

If you just place the flag in the editor and want it to always have that texture, then what rawrbear said is enough. Though just for making it clean you can add if isServer condition, as in:

if (isServer) then {this setFlagTexture "flag.jpg";};

It will work either way, though, since init lines are run on all machines, including the server. That specific line simply won't do anything when run on clients (setting flag texture on the server will set it for everyone, while setting it on a client will do nothing). Note that this is may be different from how other texture-related commands work.

If you want to change a flag's texture in a script that runs during the mission, you must make sure that the script is running on the server. How to do that depends on how you run said script and what that script is actually meant for.

Share this post


Link to post
Share on other sites

I would use .paa format though. I've had issues before with .jpg not having mipmaps and showing up black at distance.

Share this post


Link to post
Share on other sites

You are AWESOME people, I can't thank you enough.

I greatly appreciate all your input, thank you all very much.

Share this post


Link to post
Share on other sites

People I forgot to ask you if there is a maximum number of KB for a flag

that I must respect??

Share this post


Link to post
Share on other sites

Smaller the better of course, as long as it looks decent. Having a 5MB mission because you used a high rez flag might be considered bad form. :)

The flags in that pack were from 4KB to 22KB in size.

Share this post


Link to post
Share on other sites

Now I have another problem, I tried to do with a Notice board

the same thing that I did with the flag but it doesn't work :(

if (isServer) then {this setObjectTexture "ammoloadout.paa";};

can you be so kind to tell me what I did wrong ??

N.B. the texture is 128x128 pixels because the notice board is

very small I couldn't find a bigger board:(

all the very best

ranker

Share this post


Link to post
Share on other sites

It's because you have 'this' in there and are running that from a script I imagine?

Just put:

this setObjectTexture "ammoloadout.paa";

in the init field of the board on the map. That should do it.

Share this post


Link to post
Share on other sites

http://community.bistudio.com/wiki/setObjectTexture

In MP this command has only local effect. If you want to change a texture on all clients, you have to execute this command on each client. This command has also a bug: when a saved game is loaded the texture you have set will disappear and needs to be reset.

So this is different than the setflagtexture command. It actually needs to run on all machines, not just the server, so what kylania said should solve your problem.

Share this post


Link to post
Share on other sites

darn, you are awesome people thank you.

If I may ask another question please....

In the editor, I work in 2 D, I use to work in 3 D but too much

trouble because I had to reconvert to 2 D after, so my question is this...

I would like to make a wall with sand bags, how to put a bag on top

of another one??

Is it possible to do?? and How should I do this (in 2 D editor)??

Once again many many thanks good people

Ranker

Share this post


Link to post
Share on other sites

I'd use pre-made walls or HESCO barriers rather than try to stack items on top of each other.

Here's what the available walls look like and their classnames:

hescowalls.jpg

Share this post


Link to post
Share on other sites

I'd suggest a 256x128 resolution still (unless you want to have a square flag)

there are many types of barriers in the editor, also sandbag-walls. you don't need to stack each sandbag on another yourself.

just throw all kinds of barriers in the editor and check them out ingame with the preview. sometimes one expects one thing by it's classname and is surprised to see something different... sometimes a welcome surprise.

but you can with setpos. put this in the init of the object you want to have on top of another:

this setpos [(getpos this select 0),(getpos this select 1), 2];

the number 2 is the height position (in this case 2 meters). you can change it to your desired value - with either full numbers or with period as komma (i.e. 2.5 for two and a half meters height)

Edited by Bulldog Six

Share this post


Link to post
Share on other sites

kylania

Do you put those class name in the "initialization" of the item

or is it only when you write a script??

can you elaborate a bit farther sir ??

Because the only one I have (relative of the wall I want to make) in the editor are....

H-BARRIER; H-BARRIER (LARGE); H-BARRIER (SHORT); H-BARRIER CUBE.

Bulldog Six

yes sir, you are so very right about the Flags thanks a lot.

Regarding the stacking H_barrier, I will have to write this

in the initialization of one piece and then I will Copy & Paste

all the way lol (darn! it is a very long wall lol)

I appreciate your help very much good people

N.B. As I didn't remember the name, I told you people

that it was sand bags lol, but now I know they are H-BARRIER.

Ranker

Edited by RANKER
forgot something

Share this post


Link to post
Share on other sites

Well there are sandbag walls too, but yeah those H-barriers (or HESCO barriers) are another option.

The Legend of my pic tells you where in the editor to find them.

---------- Post added at 12:47 PM ---------- Previous post was at 11:31 AM ----------

Here's a quick demo mission showing you both stacking items using the setPos example from above and using the classnames to create a wall on the fly.

Share this post


Link to post
Share on other sites

kylania

Your mission sqm is fence "desert", I do not have that

terrain in my editor:(

I am working on takistan terrain, I can not see your demo :(

So sorry sir.

Ranker

Share this post


Link to post
Share on other sites

Desert_E and Takistan are two maps that ship with Operation Arrowhead. If you have Takistan you have Desert. :)

When you select Singleplayer -> Editor you should see this screen:

aPfk2.jpg

Proving Grounds is the PMC DLC map and Shapur is the BAF DLC map, but the other three are default with Operation Arrowhead.

Share this post


Link to post
Share on other sites

So sorry to be stupid sir :D

My bad lol

Thank you.

Ranker

Share this post


Link to post
Share on other sites

No problem at all. Notice that stacking items in the Editor can get a bit confusing, like even though the walls match up in the world in the editor they are slightly offset.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×