Home   Help Search Login Register  

Author Topic: Spawning Buildings  (Read 5318 times)

0 Members and 2 Guests are viewing this topic.

Spawning Buildings
« on: 13 Jul 2009, 02:15:17 »
Hi: I searched for what I am asking here but found nothing, not sure if I searched with the wrong words or not. So if there is a topic on this please direct me there ty. I am adding buildings to each town on the sahrani map with the RTE. It shows the tree,the sqf, and the sqm. Is there a way to spawn the buildings with an sqf file when the map loads or we enter each town to do battle. If so how would I do this and write that sqf? If someone could give me an example using these 2 buildings ( Land_dum_istan3_hromada ) an ( Land_dum_istan3_hromada2 ) from script start to finish. And I would activate this with a triger correct? or the init? Tyvm, Robert.
« Last Edit: 13 Jul 2009, 20:26:49 by SpectrumWarrior »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Spawning Buildings
« Reply #1 on: 13 Jul 2009, 23:19:57 »
You can export the currently placed items in RTE as an sqf file to load them in a mission or even merge it into your mission.sqm. Look up your RTE documentation on how to use RTE Capture.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Re: Spawning Buildings
« Reply #2 on: 14 Jul 2009, 00:34:51 »
I knew I could export the sqf. I guess my question should of been, How to use the sqf file, it has no start/header or finish/end? Do I just make the sqf the way it comes out in the RTE and put it in the mission folder and then triger it at each town ( [] exec "townname.sqf"; ) or this way ( [] execVM "townname.sqf"; )  and then if I want them all to spawn on mission load I us the init file to ( [] exec "Building.sqf"; ) or ( [] execVM "Building.sqf"; ) right? Because it does not say in the sqf ( _xxx = createVehicle/unit ["buildingname", _poscreate, xxxx, xxxxx, xxxxx]; ) or anything to that  nature. I find no documentation in my computer on how to use RTE Capture. I redownloaded it and still found no manual. I did find an online manual. It says
Quote
Handling of exported data:
"Convert to script"
"Convert to script" will convert the currently loaded xml-file into a sqf-script. To create the objects in ArmA, simply run that created script by the "Init.sqf".
It still does not say how to convert to sqf, or where to get anything that will preform this act. I know you don't just click save as and save as .sqf lol cause I tried that. So basicly all I am asking is how to write a spawn building sqf say using these 2 buildings ( Land_dum_istan3_hromada ) an ( Land_dum_istan3_hromada2 ) for example? Please help, I am sorry I do not know how to write scripts.
I went and downloaded arma edit and scrpt edit and other arma tools and still had no clue what I was doing to write a script.
« Last Edit: 15 Jul 2009, 08:06:55 by SpectrumWarrior »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Spawning Buildings
« Reply #3 on: 16 Jul 2009, 14:52:01 »
You run SQF scripts with execVM (though there are other, more advanced, ways to do this that you don't need to worry about), but run SQS scripts with exec. The game does not read the file extension, so you need to ensure you use the correct command, to avoid getting errors if you are running using the wrong parser.

Regarding use of the RTE itself, I'll leave it to someone else to explain, since I don't use it (And the author, i0n0s, does frequent this board).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Re: Spawning Buildings
« Reply #4 on: 16 Jul 2009, 17:08:43 »
This is the way the xml comes out
Code: [Select]
- <mission>
- <object>
  <class>AAHO136</class>
- <pos>
  <x>14616.1</x>
  <y>9160.59</y>
  <z>0.72626</z>
  </pos>
  <id>0</id>
  <dir>-73.9229</dir>
  <special>NONE</special>
  <lock>UNLOCKED</lock>
  <health>1</health>
  <fuel>1</fuel>
  <ammo>1</ammo>
  <init>this setVectorUp [0,0,1];</init>
  <name />
  </object>
this is the way it comes out in sqf
Code: [Select]
[
[],
[],
[],
[
[0, ["AAHO136", [14616.1, 9160.59, 0.72626], -73.9229, "NONE", "UNLOCKED", 1, 1, 1, " this setVectorUp [0,0,1];", ""]],
],
[],
[],
false,
true,
[]
]
I tried running the sqf by init and triger. All I keep getting is
Quote
error missing [ [
See what I am saying about there is no start/header/opening/createvehicle/etc.  or finish/ending to either of the files, how do you write the starting of the sqf to create the buildings? I mean I understand I can just merge it into the mission.sqm and the buildings will be there always. But I wanted to run them as trigered sqf's so the buildings are only there when entering the towns to prevent lag. I mean hell lol atleast I am trying on my own. Could you just please show me how I would write a create building sqf. I have tried taking some of my createvehicle/createunit scripts and changing them to buildings and I am doing something wrong for it is not working that way either.

GRRRR lol I tried this
Code: [Select]
_building = createVehicle ["AAHO136", [10548.799805,9429.959961,-1.161700], azimut=352.537994, special="NONE"];
init="this setPos [10548.8, 9429.96, -1.1617]; this setPos [10548.8, 9429.96, -1.1617]; this setDir 352.538;  this setVectorUp [0,0,1];
I tried this
Code: [Select]
_building = createVehicle ["AAHO136", [10548.799805,9429.959961,-1.161700], 352.537994, "NONE"];
I tried this
Code: [Select]
_camp = createVehicle ["AAHO136", _pos, [10548.799805,9429.959961,-1.161700], 0, "NONE"]; and this
Code: [Select]
_camp = createVehicle
["AAHO136",
_position=
{
10548.799805,
-1.161700,
9429.959961
};
azimut=352.537994;
special="NONE";
                                      ];
init="this setPos [10548.8, 9429.96, -1.1617]; this setPos [10548.8, 9429.96, -1.1617]; this setDir 352.538;  this setVectorUp [0,0,1];doStop this;";
];
Dadblame it lol how do you write this thing
« Last Edit: 16 Jul 2009, 22:43:39 by SpectrumWarrior »

Offline i0n0s

  • Former Staff
  • ****
Re: Spawning Buildings
« Reply #5 on: 18 Jul 2009, 02:32:08 »
The created SQF is a little different than your posted code:
Code: [Select]
[
[],
[],
[],
[
[0, ["AAHO136", [14616.1, 9160.59, 0.72626], -73.9229, "NONE", "UNLOCKED", 1, 1, 1, "this setVectorUp [0,0,1];", ""]]
],
[],
[],
false,
true,
[]
] call ION_RTE_fRestore;
The function in the last line contains the createVehicle etc. It requires RTE to be installed (at least on the server) and working extended eventhandler.

Re: Spawning Buildings
« Reply #6 on: 18 Jul 2009, 04:24:11 »
Well chit thanxs for the reply's spooner, i0n0s,  BUT now that brings me back to the original question then. How do you write a create sqf? Because I was planing on taking the editor update building code/# ( example "AAHO136", ) and replacing it with the actual class name of that building ( Land_Panelak3 )
 so people coming to my server can come right in w/out having to get that message saying you can not play edit this mission etc. and not have to go d/load the editor update to join my server. I am just using the RTE to place the buildings so I do not have to place a roadcone, save, change the name in the sqm, load the sqm, preveiw it, and repete for hours lol untill every building is in place properly.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Spawning Buildings
« Reply #7 on: 18 Jul 2009, 06:57:35 »
Edit the addons[] and addonsAuto[] in the mission.sqm.

Re: Spawning Buildings
« Reply #8 on: 18 Jul 2009, 13:34:56 »
kju: If you mean take out the part that says addons required editorupdate, that won't work because then only people with that addon will see the buildings. Plus that defeats my main idea, I want the  buildings to spawn by triger for each town so the buildings are not on the map in every town throughout the whole game to help prevent lagging. The reason for all this is because I have a 31 city mission, and adding buildings to each town. that's a LOT!!!! of buildings on the map lol. P.S. Does any1 know where I can find a list of the class names for the streets? I have  all the class names for everything in the editor except the streets and can not find them anywhere.
« Last Edit: 18 Jul 2009, 13:58:40 by SpectrumWarrior »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Spawning Buildings
« Reply #9 on: 18 Jul 2009, 13:42:31 »
I see.

Well there is an editor update out there that does not introduce new classes.

Re: Spawning Buildings
« Reply #10 on: 18 Jul 2009, 14:04:27 »
The only 2 i know of is the lowfly editor update and bob the builder wich that one freezes up my computer when I try to use it. It would be so much easier if someone would just show me how to write a spawn/cretae building script/sqf.

Offline i0n0s

  • Former Staff
  • ****
Re: Spawning Buildings
« Reply #11 on: 18 Jul 2009, 16:59:03 »
The one from 6th Sense doesn't require to be installed on other computers.

Re: Spawning Buildings
« Reply #12 on: 18 Jul 2009, 18:37:35 »
Thank you i0n0s I will try that one, But I don't understand why I can not just be shown how to write a create building sqf. Because even if I use that one will I not still be faced with that same problem of all the buildings on the map on mission load? I just need a create building sqf Please? So I can triger each town as we enter it to battle. And using your sqf way
Code: [Select]
[
[],
[],
[],
[
[0, ["AAHO136", [14616.1, 9160.59, 0.72626], -73.9229, "NONE", "UNLOCKED", 1, 1, 1, "this setVectorUp [0,0,1];", ""]]
],
[],
[],
false,
true,
[]
] call ION_RTE_fRestore;
I saved the above code as an .sqf, put it in my folder, added [] execVM "building.sqf"   to the init.sqf  and nothing happened at all, no building, I am still getting
Quote
error missing call ION_RTE_fRestore;
when I tried to run it by a triger.
« Last Edit: 18 Jul 2009, 22:23:25 by SpectrumWarrior »

Offline i0n0s

  • Former Staff
  • ****
Re: Spawning Buildings
« Reply #13 on: 19 Jul 2009, 00:51:19 »
Take a look at the attached file. You may notice that the file is a little complex.

About the trigger:
Replace the first [ with:
Code: [Select]
nul = [

Re: Spawning Buildings
« Reply #14 on: 19 Jul 2009, 02:11:41 »
Well I am not gettin an error anymore BUT I still am not gettin a building on the map either.  just to make sure I did it right this is what I tried. I saved one building as an .sqf  and made a triger set anyone and put this in the on act  nul = execVM "1.sqf";    I did not get an error and  I had no building show as I ran accross the triger.  I also tried to activate the building through the init.sqf and still no building showed on the map. Now lets start from the begining lol. You open the RTEcapture, start arma, start monitoring, place man on map, preview, start the editor, place building on map, export all, alt-tab to RTEcapture, You save this as the .sqf?
Code: [Select]
[
[],
[],
[],
[
[0, ["AAHO136", [14616.1, 9160.59, 0.72626], -73.9229, "NONE", "UNLOCKED", 1, 1, 1, "this setVectorUp [0,0,1];", ""]]
],
[],
[],
false,
true,
[]
] call ION_RTE_fRestore;
put it in your mission folder, go back to your game, load that mission, make a triger set anyone and put this in the on act  nul = execVM "1.sqf"; am I missing any steps.files,etc. because that's the steps I took and when I ran to the triger nothing happened. I even created a test pbo and loaded on a test server with RTE on the server and still nothing happened.

 and what about the xml file what do you do with it and where do you put it? Because the xml file is just a rough cut of what actually goes into the .sqm file when you merge it. So it sould have no control over the .sqf and triger if I saved everything right and executed it properly.
« Last Edit: 19 Jul 2009, 05:14:40 by SpectrumWarrior »

Offline i0n0s

  • Former Staff
  • ****
Re: Spawning Buildings
« Reply #15 on: 19 Jul 2009, 13:08:24 »
You saved it as "1.sqf"?

Which trigger activation do you use?

And about this:
... working extended eventhandler.
Does it ring when starting the RTE the first time? Does starting it the first time takes some time?