Jump to content
Sign in to follow this  
Frantic

straight objects on uneven ground

Recommended Posts

Hi all.

I wanna place objects like a house for example on an uneven ground, but the object should be straight and not uneven like the ground beneath it.

Is there a command to make the objects straight, no matter how the ground is?

with best wishes

Frantic

Share this post


Link to post
Share on other sites

Thx alot!

now i just need to find out if it works on dedi servers too! thumbs-up.gif

Share this post


Link to post
Share on other sites

You doubt it will work on dedicated servers? Tell us if it doesnt work.

Share this post


Link to post
Share on other sites

setvector works fine on servers too.

setpos still does not work... confused_o.gif

Share this post


Link to post
Share on other sites

Make a script with this code.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;//Armed Assault Script

;

_me = _this select 0

_north = _this select 1

_east = _this select 2

_height = _this select 3

_me setpos [(getpos _me select 0) + _north,(getpos _me select 1) + _east,(getpos _me select 2) + _height]

put this in the init field of any unit: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this,1,2,3] exec "nameofscript.sqs"

Is this what you wanted for setpos? Good Luck.

or skip the script and put this in init field:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this setpos [(GetPos this select 0), (GetPos this select 1), 15]

the this can be the name of the unit

the 1 moves it north (or negative number south)

the 2 moves it east(or negative number west)

the 3 moves it up (or negative number down)

Share this post


Link to post
Share on other sites

hej thx for trying to help.

But if i use a script for putting the high, the setvector is not working anymore.

and the

Quote[/b] ]this setpos [(GetPos this select 0), (GetPos this select 1), 15]

is not working on servers.

i need a way to make setpos and setvector working at the same time... confused_o.gif

Share this post


Link to post
Share on other sites

You know more about it than I do. But I did find a page out there that might help you. (might not)

Most global variables can be transmitted over the network with the exception of

1) Strings

2) Arrays

however, even for the above variable types, there is a work around and that is COC Network services

Certain commands are local, which means that if you run that code on machine A and the actual unit is local on Machine B, then the unit wont be effected by that command

certain commands are global, which means no matter which machine you run it on, the unit/object will be affected by that command

Example of a global command

SETPOS

Example of a local command

SETDIR

Problems can arise when you issue a global command on every machine

eg if you have all machines run a script from say a trigger with a setpos command in thst script, the affected unit will be setpossed numerous times, this can obviously be problematic

So to avoid this from happening, we can use switches, as in the example below

?(Local _unitname): _unitname setpos (getmarkerpos "Safezone")

If you want specific code run on a server, then you can create a gamelogic, call it "server" and then use the following piece of code

?(Local Server): _unitname setpos (getmarkerpos "Safezone")

Reason: Gamelogics created in the mission editor are local to the server only, so by referring to the name of the gamelogic as in the above example, we can be assured that the code it runs will only be run once and run on the server only

Don't know if that helps. I don't really understand it.

Share this post


Link to post
Share on other sites

Since ArmA strings can be send over the net with publicVariable.

setDir is global.

whistle.gif

Share this post


Link to post
Share on other sites

I really need a crash course in the whole " Global Commands Don't Work on Deticated Servers Thing ".

Can someone with knowledge on the subject please describe the problem in a simple way. You can even say "Global commands don't work with Det. Servers Period."

Then explain how to work around the problem (if possible). In a simple way. If there isn't a simple way then provide a simple mission demonstrating the right way to do it.

Thx

Share this post


Link to post
Share on other sites

Till now ive only found out that setpos is not working on dedicated servers.

Has anyone found out more things which are not working on dedi servers?

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  

×