Jump to content
LastNerve

Arma 3 scripting questions.

Recommended Posts

Hi everyone new to scripting came a long way and have some maps almost done but would like to change and add 2 things!
 

I want to a add a kill log feed during the mission... tried this code and everytime it says "couldnt find killticker.sqf...but its in the folder and i have done everything inside and out just never says it can find killticker.sqf. any other way to add a killfeed by chance?

lastly, I have friendly set to where it shows who is who if you point your gun at them but i would like to have a icon or the name show above there head at all time like koth or something. I googled but couldnt find any script examples! I did come across this, but it didnt work for whatever reasons http://www.armaholic.com/page.php?id=23512 and thats what im looking for so any help would be greatly appreciated! Thanks!

Share this post


Link to post
Share on other sites

check your directory.

where is the initialization script?

if you place a script in

Quote

\scripts\myScripts\aScript.sqf

then you need to execute it like this:

call compile "\scripts\myScripts\aScript.sqf";

 

Share this post


Link to post
Share on other sites

oh okay i didnt do that and it was in a folder figured game would just find it as long as it was in the maps mission folder...so I need to write call compile blah blah in my description .ext file or init file

 

Share this post


Link to post
Share on other sites
1 hour ago, LastNerve said:

oh okay i didnt do that and it was in a folder figured game would just find it as long as it was in the maps mission folder...so I need to write call compile blah blah in my description .ext file or init file

 

Initialization Order

Event Scripts

The description.ext is reserved for properties that are written in the mission, for things like respawning and sound configuration. Not scripts.

Remember, init.sqf will run at mission start. So it really depends on when you want to load this. 

Off the top of my head you can do something like this:

Player Initializes > start script and start counting

Server Initializes > Start the script on all players in server (JIP issues will definitely occur).

Depending on how the script operates you may or may not want to run it in the init.sqf, so do some investigating.

"call compile" is basically "[] execVM". 

so in your init.sqf : 

[yourRequiredParamsHere] call compile "scripts\myScriptFolder\bulletick.sqf";

 

  • Like 1

Share this post


Link to post
Share on other sites

okay i got it working...I still get a killfeed.sqf not found error but it works...not sure why it says that i dont even have any listing for a killfeed.sqf anywhere its not important i suppose you just have to hit close and everything loads and works like it should! Thanks!

now for part 2. have had no luck finding any info.
I would like to have friendly tags or atleast icons show up so friendly dont kill one another by accident..regular difficulty if you point at them there name will show up but i would like for it to show 24/7 or a icon to show 24/7 name would be better but a icon would do. I cant find any info while googling or searching have any idea how i go about that?

Share this post


Link to post
Share on other sites
2 hours ago, LastNerve said:

now for part 2. have had no luck finding any info.
I would like to have friendly tags or atleast icons show up so friendly dont kill one another by accident..regular difficulty if you point at them there name will show up but i would like for it to show 24/7 or a icon to show 24/7 name would be better but a icon would do. I cant find any info while googling or searching have any idea how i go about that?

 

Something like that?

In initPlayerLocal.sqf:

addMissionEventHandler ["Draw3D", {
  _this call {
    {drawIcon3D ["", [1,1,0.15,1], [visiblePosition _x select 0 , visiblePosition _x select 1, (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5],0,0,0,name _x,1, 0.03,"EtelkaMonospacePro"]} forEach (allUnits select {side _x == playerSide})}}];

 

  • Like 1

Share this post


Link to post
Share on other sites
51 minutes ago, pierremgi said:

 

Something like that?

In initPlayerLocal.sqf:


addMissionEventHandler ["Draw3D", {
  _this call {
    {drawIcon3D ["", [1,1,0.15,1], [visiblePosition _x select 0 , visiblePosition _x select 1, (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5],0,0,0,name _x,1, 0.03,"EtelkaMonospacePro"]} forEach (allUnits select {side _x == playerSide})}}];

 

Thank you very much! I have searched the all over the web and couldnt ever find something but that is exactly what I was hoping for thanks a million!

Edit: is there anyway to change the color and lower the text down closer the player... or send me to the right direction and i can probably figure it out. thank you sir!

 

Share this post


Link to post
Share on other sites

Yes, color are RGBA in the second parameter here [1,1,0.15,1] from 0 to 1 each color + alpha.

To set the high above unit, change (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5 to what you want here 2.5 m above foot.

NB: This seems to be complex but the visiblePosition (AGL oriented) fails when a unit is in multi-floored building (name stays at ground level).

 

You can also cope with zoom factor but it's even more complex.

Share this post


Link to post
Share on other sites
23 hours ago, pierremgi said:

Yes, color are RGBA in the second parameter here [1,1,0.15,1] from 0 to 1 each color + alpha.

To set the high above unit, change (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5 to what you want here 2.5 m above foot.

NB: This seems to be complex but the visiblePosition (AGL oriented) fails when a unit is in multi-floored building (name stays at ground level).

 

You can also cope with zoom factor but it's even more complex.

took me a minute to figure out what you ment about +alpha (opacity) but i got it figured out! I was looking at my PS colors and couldnt figure it out. I figured to change color would be like #FF02234 but thanks again for all your help! Ive got everything I needed! LRB 24/7 server is up and running with really well put together maps now and more to come! Thank you all!

  • Like 1

Share this post


Link to post
Share on other sites
On 5/3/2017 at 9:10 AM, pierremgi said:

 

Something like that?

In initPlayerLocal.sqf:


addMissionEventHandler ["Draw3D", {
  _this call {
    {drawIcon3D ["", [1,1,0.15,1], [visiblePosition _x select 0 , visiblePosition _x select 1, (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5],0,0,0,name _x,1, 0.03,"EtelkaMonospacePro"]} forEach (allUnits select {side _x == playerSide})}}];

 

so with this script is there a way to remove the name tag from your own player, i'm pretty new to the scripting game and was just wondering.

Share this post


Link to post
Share on other sites
1 hour ago, Sloppy on pc said:

so with this script is there a way to remove the name tag from your own player, i'm pretty new to the scripting game and was just wondering.

 

just minus player 

(allUnits select {side _x == playerSide}) - [player]

 

 

Share this post


Link to post
Share on other sites
3 minutes ago, killzone_kid said:

 

just minus player 


(allUnits select {side _x == playerSide}) - [player]

 

 

awesome thanks for that mate!

Share this post


Link to post
Share on other sites

addMissionEventHandler ["Draw3D", {
  _this call {
    {drawIcon3D ["", [0,0.839,0.012,1], [visiblePosition _x select 0 , visiblePosition _x select 1, (ASLToAGL(visiblePositionASL _x) select 2 )+ 2.5],0,0,0,name _x,1, 0.03,"EtelkaMonospacePro"]} forEach (allUnits select {side _x == playerSide})- [player]}}];

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

×