Jump to content
Sign in to follow this  
igneous01

createmarker works only half the time??

Recommended Posts

this is an interesting problem that i cant really solve. I have 3 gamelogics, all spread out on the map, and in a trigger i have a script called that creates and sets up the markers. Sometimes when i pass through the trigger, all 3 are created, other times, only 2 are created, and it seems to me like it randomly picks 2 of the 3 and shows them.

Does the gamelogic disappear or become destroyed? im using it as a position to spawn a couple of units. but not all the markers are drawing.

heres the script:

primemark1 = createMarker ["pm1", (getpos m1)]; 
"pm1" setMarkerColor "ColorRed"; 
"pm1" setMarkerText "Possible Artillery position"; 
"pm1" setMarkerType "Unknown"; 
primemark2 = createMarker ["pm2", (getpos m2)]; 
"pm2" setMarkerColor "ColorRed"; 
"pm2" setMarkerText "Possible Artillery position"; 
"pm2" setMarkerType "Unknown"; 
primemark3 = createMarker ["pm3", (getpos m3)]; 
"pm3" setMarkerColor "ColorRed"; 
"pm3" setMarkerText "Possible Artillery position"; 
"pm3" setMarkerType "Unknown";

nothing too fancy, they all have their names checked out and attached to the proper logics.

so why isnt it consistent?

Share this post


Link to post
Share on other sites

Maybe it needs: "marker" setMarkerShape "ICON"; ?

Game Logics dont get destroyed. If one of them doesnt exists, you should get error (with -showscripterrors) when trying to get itsposition with getpos.

Share this post


Link to post
Share on other sites

i always tell people the same thing...use io to your advantage.

as shk suggests, use error reporting

however, sometimes it's not a runtime error, and its not a compiler error...and when this happens, you get a logic error...which basically means nothing will notify you that it's wrong, because technically, it's doing exactly what it's supposed to: its a user error (i.e. you have a boolean that says if 4+4 < 2, and it never evaluates to true)

so in this case, i suggest dumping everything you possibly can to the screen related to the problem (seeing as there is nothing to step through a mission line by line).

so, first off, verify that the points are created...put a hint before anything in your trigger gets run...then put a hint after everything that happens to verify it executes properly

although in this particular case, error reporting should suffice

Share this post


Link to post
Share on other sites

looks like im gonna have to do that, and add the seticon type (which i thought it would do it automatically)

i just find it strange that it can work and it cant. meaning the fault can be 50% logic error sometimes.

im guessing its my logic, i never got any errors in my rpt or with showscripterrors

Share this post


Link to post
Share on other sites

If it helps, I have a slightly different way that I do this. Instead of game logics, I put down default markers with the names that I will want later on. They're not visible to the player. Then I simply adjust its attributes when I do want it to be visible. Here is an example of one of mine:

"mrkWhiskeyOne" setMarkerType "mil_arrow2";
"mrkWhiskeyOne" setMarkerDir 230;
"mrkWhiskeyOne" setMarkerColor "ColorRedAlpha";
"mrkWhiskeyOne" setMarkerSize [1,2];

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  

×