Jump to content
Sign in to follow this  
victim913

height/setpos question/ translating the search results for me.

Recommended Posts

This started as a simple question but became bigger by trying to understand all the results i came across and script translations. I searched this forum and found many results. They seemed to just confuse me more. I am trying my first mission using RTE and 2d editor.

I place objects in the 3d RTE and set them exactly where i want them. However when i load my mission back in, many of the heights, and positions moved significantly. Most change to different angles, others raise up or down. Usually on uneven terrain or slopes.

What i need help with is this;

- i want to place earth rampart and trenches on a slope. i get them where i want in rte with angles and heights where i want, when i load the mission everything goes back to a 90 degree angle/flat leaving invisible bottoms.

-if i place them using the 2d editor, they have the right angle but the trenches end up being at least a foot high off the ground.

If i used the RTE the init field has "this setPos [x,y,z]" after i have merged it with the mission.But using the 2d editor i don't get that info.

I want to place them in the 2d editor so that the match the terrain, but it doesn't show me the x,y,z. How can i place an object in the 2d (so it has the right angle) so that i can only change the z value, without messing with the x,y? Is there a code, for example, "setpos height = ?"

I guess i could put them in with the RTE and play around with the vector, but then it's all guessing and checking over and over until it's right. But then the problem will get worse when i have a couple objects in tight space. Next thing i know changing the vector, i have a tank shoot up 30 feet in the air cause everything is off.

And if anyone has an answer to this, can you let me know what the code means? It's all chinese to me. I get confused when i look at some of these codes. It's usually taken for granted that we all know what all the terms mean. This is how bad i am. I saw a code saying this;

player setPos (getPos someobject)

getpos, setpos. I don't know if "player" is the name of the unit, or my name, or if it is supposed to say player period. And then (getPos someobject), is that part of the code or is that a note for me?

And worse is this? I am trying to figure out how to fold the blades of a cobra. I searched this, and i tried copying this exactly and put it in the init but nothing happens:

_xtype = [this,1] execvm "\ca\air\Scripts\AH1Z_fold.sqf

This is how i keep seeing script. Everyone throwing a script up and i am supposed to know all of the meanings. The biggest thing throwing me off is color. Some words are in blue or red, etc.

what is _xtype? this, is this unit, I know that, but why the 1 after [this,1]? Then this "\ca\air\Scripts\AH1Z_fold.sqf" , Is that code or a file location?

Is there any good "dummies" for scripting tutorials? I have looked at alot of the stuff here and armaholic, biki,or wiki but it still requires me to know a little about scripting to begin with.

ALL of the scripting help that i have seen is no help, like comref? Basically I need to know scripting in order to learn it. It feels like I am learning to speak spanish, from a book written in spanish. Where there is no english to spanish help. I'm lost:eek:

I asked how to keep my weapons while in water, like a navy seal stealthy swim instead of a noisy boat. Someone told me;-- make a waituntil checking for surfaceIsWater, once false, it would add weapons.-- I don't even know where to start or how to go about it. But thats how all scripting help seems to be.So i searched the bistudio,wiki and searched "surfaceIsWater" ;

Description:Returns whether water is at given position- huh? returns what?

then,

Syntax:Boolean = surfaceIsWater [x, y]

Parameters:[x, y]: Array - format Position2D

Return Value:Boolean

No where did it tell me what it means (in english) or how i would use it or how to apply it and why. That is all it said about SurfaceIsWater, why not show examples, like how to use it and what would i use it for. More importantly, why don't they just say what it means. To me i would assume it means the ground(surface) is water. But if it is to help me with keeping weapons, then it must mean the opposite, WaterIsSurface? Shouldn't it? How does that keep my weapons? And give a couple exaamples using it in a script so that i can get an idea of how,why,when i would use it. What is Boolean anyway?I see it everywhere.

I have been able to look at user missions to get an idea of how they used script. I don't see anything that tells me why the script is being used. I searched the wiki bis stuff and i try to click on all the links so i can learn it all, but it seems to go around in circles. I start withx, link to y, then link back to x. starting me over again. Each one promising a definition if i click the link, then another, and another. Then i end up with 4 or 5 words i am looking for. The closest i get is finding a glossary of script terms with no meaning or how-to, with a definition. There seems to be alot of info out there, just sorting through it all is tough when it is a foreign language to me.

So if anyone out there can point me to a "i'm stupid, teach me script" tut thank you , if not can you at least get me going in a good direction. THANKS

Share this post


Link to post
Share on other sites

The code you want is

this setpos [ getPos this select 0, getPos this select 1, z]; 

in the init. The first two variable being x and y. I don't use the 3d editor, so can't give you any tips there. Variables given in [square brackets] are parsed to the called script (in the example you gave).

The book you're after is Mr Murray's Deluxe Editing Guide, dodgy English version: http://www.armaholic.com/page.php?id=4848

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  

×