Jump to content
Sign in to follow this  
demonized

create marker with no name??

Recommended Posts

in my script i use BIS_fnc_spawnVehicle to spawn a heli with crew and then assign it waypoints to go to.

Problem: when i try to set wp position to center of a rectangular marker, wp is set to lowest furthemost left of mapscreen, why?

Ive worked around this problem by having empty markers placed in editor centered on the rectangle markers and setting wp to them instead.

I tried in same script to create a marker(instead of having them preplaced in editor) and set created markers position to rectangle marker using a _name instead of name, so that i can run script many times same time without conflicts, but i get errors.

Anyone know if it even possible to do something like this?

Ive tried different approaches using markerPos, with and without () etc...

problem was upsmon related

Edit: maybe i should just use invicible h´s.

Id still like some info on the above if anyone can shed some light on this?

this is whats causing the problem:

first deployment works with invicible h, then second time AFTER upsmon is started on marker it sets next invicible h to the lowest most left corner of map.

This is what i think is the problem in the upsmon script:

// show area marker 
_showmarker = if ("SHOWMARKER" in _UCthis) then {"SHOWMARKER"} else {"HIDEMARKER"};
if (_showmarker=="HIDEMARKER") then {
//_areamarker setMarkerCondition "false"; // VBS2
_areamarker setMarkerPos [-abs(_centerX),-abs(_centerY)];
};

It sets the marker to some form of absolute value, unsure about the details.

link to bis info on abs : http://community.bistudio.com/wiki/abs

Anyone know a way i can work around this in script without making adjustments to upsmon itself??

How to create a marker or invicible h on marker position after scripting above is run on it?

Regards

Tried alot of diff stuff, and finally got this and results was working!!

Reversing effect:

http://forums.bistudio.com/showthread.php?p=1808557#post1808557

I still dont fully understand what abs does exactly when used like in above, anyone with a better explanation than bis wiki please feel free to post here.

Edited by Demonized
problem solved, unsure of long term consequenses

Share this post


Link to post
Share on other sites

Abs returns the absolute value, which will be a positive number (or 0) in all cases. So if you were finding how far an object on the screen is to the left or right of center, where center has an x value of 0, 50 pixels left will be negative 50, and 50 pixels right would be positive 50. You don't want the negative, just the distance, so abs will return positive 50 in both cases. Hope that makes sense :)

Share this post


Link to post
Share on other sites

I was gambling on -abs meant underground, and abs meant over, after i looked at that bis info, testing supports that.

So here where -abs have a - in front, means it will set it to 0 or any negative number, meaning underground (out of sight).

And with no - infront, just abs it will be opposite, 0 or any positive number

Underground with -abs:

_areamarker setMarkerPos [-abs(_centerX),-abs(_centerY)]; i only see x and y here no Z but maybe Z is set anyway.

Overground with abs:

_areamarker setMarkerPos [abs(_centerX),abs(_centerY)];

Share this post


Link to post
Share on other sites

To answer the topic heading, you can't create nameless markers. If you try within the editor, it won't let you.

You got errors on name because it is a scripting keyword/command.

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  

×