Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Bluntman

Avatar / Picture

Corporal
Registered:
Posts: 36
Reply with quote  #1 
I'd figure I would ask here as I have been looking online for a simple understanding involving scripts and the placement of them within the mission folder.....for example I wanted to use a mortar script by zonekiller, but I have no clue how to make it work. 

I understand a "functions module" needs to be placed on the map, does it need to be synced to the mortar unit?  I assume so. 

also this code _nil = this execVM "mortar.sqf"; does this go into the init field of the mortar unit while in map editor?   I'm [confused] please help a noob out. 

Many thanks in advance!



after tooling around I placed Global_Guided_Code.sqf, Global_Launch_Code.sqf and Mortar.sqf in my missions folder. So now I have a total of 4 files including the mission.sqm ..... http://ironfront.forumchitchat.com/post/ai-mortar-script-package-by-zonekiller-6332912?trail=90 

I placed in the units init field:
_nil =this execVM "mortar.sqf";

I then placed a functions module on the map as required in the readme........is there something I am missing?
0
Giallustio

Corporal
Registered:
Posts: 53
Reply with quote  #2 
Well it depends from the script.

MP or SP? It makes a big difference.

Take a look here: https://community.bistudio.com/wiki/Initialization_Order

If you put any code in the init field of any unit, it will be executed in every machine. So if it's SP, you're okay, in MP depends of the script.

I usually not use the init field of the unit, I prefer to use the init.sqf, more organized, but it's IMO of course [wink]

__________________
If you'd like to support my work: 

http://www.giallustio.altervista.org/donate.html

0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #3 
The way you have done it seems to be correct. I am assuming by the fact you have posted, that its not working? Could you upload your mission so I can have a look?
0
Bluntman

Avatar / Picture

Corporal
Registered:
Posts: 36
Reply with quote  #4 
Hello Tayuk...correct its still not working [frown] ....here is the link to the mission https://mega.nz/#!mM41mJIR!pO8emwn0Jr9NXY5YFFLcyvxX_eKKN9Nsoxb4GFT6K9Q  Thanks for looking into it.  I appriciate it.

Thanks Giallustio for your suggestions [smile]
0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #5 
Ok, unsync the module from the mortar, then put this line in the mortar unit's init box


0 = this execVM "mortar.sqf";


Just tested it and it works in the editor, but like Giallustio says, multiplayer is different, so may or may not work as you want.
0
Bluntman

Avatar / Picture

Corporal
Registered:
Posts: 36
Reply with quote  #6 
WOW....that is one deadly mortar crew.....thanks for clearing up what I did wrong......I've tried it in MP and SP seems to work ok sor far.  Thank you very much again.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.