TKC-Community

Hacking and Art => Armed Assault 3 => Armed Assault 2 => Topic started by: AggressiveNapkin on February 22, 2011, 11:36:22 pm

Title: New guy trying to spawn things
Post by: AggressiveNapkin on February 22, 2011, 11:36:22 pm
Just getting started with all this fun stuff. Starting small, just trying to pop up random vehicles on a Domi server. I saw a massive spawn of A10s and UAVs dropped on a base the other day, that was pretty impressive. I also read of a guy spawning an A10 for players, then freezing the pilot's controls when he came in for a run, crashing the plane and all the other players telling him to go fly a wagon and such.

Can anyone point me the right direction?  Looking to just spawn single vehicles for now, for personal use. Who knows from there. Any help would be appreciated.

(I've searched for vehicle spawning, and found a great site that lists all the vehicle classnames and such, and many other interesting tools, but nothing pertaining specifically to spawning on OA Domi servers. I know someone's probably not going to read this and just tell me to "Use search you nub," but I hope at least a couple people will be willing to help me out.)
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 12:36:19 am
_vehicle = _this select 0;


copy paste into vehiclexspawn.sqf

//
hint "Spawning Vehicle and Filling with troops..";
_units_list = units group player;
{deleteVehicle _x} forEach _units_list;
(vehicle player) addEventHandler ["handleDamage", { false }];
_grp = group player;
_myVec1 = _vehicle createVehicle (position player); // position akronym for getpos is slower though [0x048722].
_me = typeOf player;
_me createUnit [position player, _grp, "pilot = this ;"];
_me createUnit [position player, _grp, "commander = this ;"];
player action ["getInGunner", _myVec1 ];
pilot action ["getInDriver", _myVec1 ];
sleep 0.001; // beddy byes or sometimes the ai will not get in the vehicle ..
commander action ["getInCommander", _myVec1 ];
(vehicle player) setVehicleAmmo 0.9;
sleep 0.1;
(vehicle player) setdamage 0;
(vehicle player) setfuel 1;
// mission accomplished.

call it like this:

[Vehicleyouwanttocreate] execvm "vehiclexspawn.sqf";

eg onload = "[""T90""] execvm ""vehiclexspawn.sqf""";

you could also enumerate vehicle from a list but that is entirely up to you

or you could even use get nearestobject ["Tank"... ] this way no one will be suspicious when your driving a m1a1 in a mission where there is no m1a1

good luck :icon_thumbsup
Title: Re: New guy trying to spawn things
Post by: Coronel_Niel on February 23, 2011, 12:42:11 am
Im just gana say:

Createvehicle


You like to search, do a BIS wiki search on that command.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 12:48:22 am
are you suggesting using the bis function instead?

if so some do not work in oa , probably a bug.

also big tip if anyone ever writes a new script and after it runs you get a grinding drive for no reason

include the library and

put this in the second line

waituntil {!isnil "bis_fnc_init"};

have fun.
Title: Re: New guy trying to spawn things
Post by: AggressiveNapkin on February 23, 2011, 01:10:02 am
Thanks for the quick reply Medic, Niel. Medic, thank you for the code. Can you break things down Barney-style for me?

I understand that the sqf is the script I call, how do I call it once I'm in game?

Is there something stopping me from just entering "(AH6J_EP1)" createVehicle (position player);" somewhere?

I know this is all extremely basic stuff for you guys, and I appreciate your helping me figure this out. I'm a quick study, once I see how it's done once I got it for life.
Title: Re: New guy trying to spawn things
Post by: Coronel_Niel on February 23, 2011, 01:52:07 am
Please say what you mean by "BIS Function" because that post looks like a realllllly dumb one.

"AH6J_EP1" createVehicle getpos player;
Title: Re: New guy trying to spawn things
Post by: AggressiveNapkin on February 23, 2011, 02:03:56 am
Please say what you mean by "BIS Function" because that post looks like a realllllly dumb one.

"AH6J_EP1" createVehicle getpos player;

Where do I input that at, console?
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 02:53:57 am
Please say what you mean by "BIS Function" because that post looks like a realllllly dumb one.

"AH6J_EP1" createVehicle getpos player;

niel there is only 1 bis function to spawn a vehicle ..... :icon_rolleyes2
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 02:56:05 am
Please say what you mean by "BIS Function" because that post looks like a realllllly dumb one.

"AH6J_EP1" createVehicle getpos player;

Where do I input that at, console?

in a sqs or sqf file
Title: Re: New guy trying to spawn things
Post by: AggressiveNapkin on February 23, 2011, 03:00:22 am
Ok, and where do I call that file from, when I'm in game?
Title: Re: New guy trying to spawn things
Post by: Coronel_Niel on February 23, 2011, 02:53:52 pm

_myVec1 = _vehicle createVehicle (position player); // position akronym for getpos is slower though [0x048722].


Im just gana say:
Createvehicle

So what BIS function am I using that your not? That post was a jab to make you look good and now you've fallen flat on your face.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 03:29:58 pm
actually i was being helpfull niel not clever or anything else simply helpfull.

which you are not being at all with your last post  :icon_rolleyes2.

[edit removed info] pm'ed

Title: Re: New guy trying to spawn things
Post by: Coronel_Niel on February 23, 2011, 03:49:10 pm
Why the fuck would I give a guy who doesn't know where to put the code something like that  :icon_o_o

Aggressive Napkin, I would download someone else's hack and edit that to start off.
Your attempting to jump in at the deep end by making your own PBO and bypass ect. It is a lot easier to start off small and edit to being with.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 03:54:16 pm
Why the fuck would I give a guy who doesn't know where to put the code something like that  :icon_o_o



to help him ?
Title: Re: New guy trying to spawn things
Post by: Coronel_Niel on February 23, 2011, 03:56:32 pm
It would probably put him off hacking more than help him :icon_laugh

And yes, I did read it before you edited.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 08:16:10 pm
It would probably put him off hacking more than help him :icon_laugh

And yes, I did read it before you edited.

what would put him off hacking ?

Title: Re: New guy trying to spawn things
Post by: MrMedic on February 23, 2011, 08:19:48 pm
Ok, and where do I call that file from, when I'm in game?

you call it from an sqf or sqs which normally would be inside a pbo.


i have just looked to see if there are any good pbo tutorials and i cant seem to find one for you , if no one else can i will write one for you when i have the time free.

however in the meen time look here

http://www.ofpec.com/ed_depot/index.php?action=list&cat=to&type=ad
Title: Re: New guy trying to spawn things
Post by: AggressiveNapkin on February 25, 2011, 03:56:20 am
Awesome, if you have the chance, I'd really appreciate a ground-up walk through for this.
Title: Re: New guy trying to spawn things
Post by: dretcher on February 26, 2011, 11:50:54 pm
Awesome, if you have the chance, I'd really appreciate a ground-up walk through for this.
in order to be able to spawn stuff in game for your own personal enjoyment, your best bet is to go find one of the hacks on this site and download it, and read on the forums how to get it ingame. What you seem to be asking medic is how to make your own hacks. At least that is what he is explaining to you. You have to write the scripts in notepad or wordpad, and save them as an sqs or sqf file. I would go open up some arma missions to see how the codes work for arma. Then you can compile your scripts, etc., and make them into .pbo files to use them in game, which is basically the filename for addons in arma. Get binpbo or pboview for that part.
Either way, it isn't the easiest thing to make a hack for arma. Your best bet is to get darky's. There is a spawner in that that will spawn most guns and vehicles, as well as all the basic arma ammoboxes, and if there is something missing that you want, you can go find the classname for it at a site like this (http://browser.dev-heaven.net/cfg_weapons/classlist?version=18.), this (http://www.armatechsquad.com/ArmA2Class/indexA2.php), or this (http://forums.bistudio.com/showthread.php?t=73241&page=2), and use a couple basic codes in the player console section. Type in your name at the top and use the execute code box to

put in player addweapon "classname"; for a weapon
put in \player addMagazine "classname"; for ammo
put in "classname" createvehicle (position player); for vehicles.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 27, 2011, 04:22:04 pm
Awesome, if you have the chance, I'd really appreciate a ground-up walk through for this.
in order to be able to spawn stuff in game for your own personal enjoyment, your best bet is to go find one of the hacks on this site and download it, and read on the forums how to get it ingame. What you seem to be asking medic is how to make your own hacks. At least that is what he is explaining to you. You have to write the scripts in notepad or wordpad, and save them as an sqs or sqf file. I would go open up some arma missions to see how the codes work for arma. Then you can compile your scripts, etc., and make them into .pbo files to use them in game, which is basically the filename for addons in arma. Get binpbo or pboview for that part.
Either way, it isn't the easiest thing to make a hack for arma. Your best bet is to get darky's. There is a spawner in that that will spawn most guns and vehicles, as well as all the basic arma ammoboxes, and if there is something missing that you want, you can go find the classname for it at a site like this (http://browser.dev-heaven.net/cfg_weapons/classlist?version=18.), this (http://www.armatechsquad.com/ArmA2Class/indexA2.php), or this (http://forums.bistudio.com/showthread.php?t=73241&page=2), and use a couple basic codes in the player console section. Type in your name at the top and use the execute code box to

put in player addweapon "classname"; for a weapon
put in \player addMagazine "classname"; for ammo
put in "classname" createvehicle (position player); for vehicles.


a good tip is to spawn the vehicle behind you , this way if an admin is spectating you they won't see it appear.
Title: Re: New guy trying to spawn things
Post by: i mss old ofp on February 27, 2011, 06:14:48 pm
ill help you with your first script, ....

; ****************************************************************
; Custom player script for Armed Assault
; Created with ArmA Edit - Version 1.3.4000
; HELP: Run this script from the INITIALIZATION box of the player.
; CODE: [this] exec "AK47S.sqs"
; ****************************************************************

; Get the player parameter given
_player = _this select 0

; Strip the players current gear
removeAllWeapons _player

; Add the new gear to the player
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addMagazine "30Rnd_762x39_AK47"
_player addWeapon "AK_47_S"
_player removeWeapon "m16a4"
_player selectWeapon "AK_47_S"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addMagazine "8Rnd_9x18_Makarov"
_player addWeapon "Makarov"

Exit

its not much but its a start .
Title: Re: New guy trying to spawn things
Post by: dretcher on February 28, 2011, 07:52:31 am
Awesome, if you have the chance, I'd really appreciate a ground-up walk through for this.
in order to be able to spawn stuff in game for your own personal enjoyment, your best bet is to go find one of the hacks on this site and download it, and read on the forums how to get it ingame. What you seem to be asking medic is how to make your own hacks. At least that is what he is explaining to you. You have to write the scripts in notepad or wordpad, and save them as an sqs or sqf file. I would go open up some arma missions to see how the codes work for arma. Then you can compile your scripts, etc., and make them into .pbo files to use them in game, which is basically the filename for addons in arma. Get binpbo or pboview for that part.
Either way, it isn't the easiest thing to make a hack for arma. Your best bet is to get darky's. There is a spawner in that that will spawn most guns and vehicles, as well as all the basic arma ammoboxes, and if there is something missing that you want, you can go find the classname for it at a site like this (http://browser.dev-heaven.net/cfg_weapons/classlist?version=18.), this (http://www.armatechsquad.com/ArmA2Class/indexA2.php), or this (http://forums.bistudio.com/showthread.php?t=73241&page=2), and use a couple basic codes in the player console section. Type in your name at the top and use the execute code box to

put in player addweapon "classname"; for a weapon
put in \player addMagazine "classname"; for ammo
put in "classname" createvehicle (position player); for vehicles.


a good tip is to spawn the vehicle behind you , this way if an admin is spectating you they won't see it appear.
good point, i never thought of that. what do you put in in the parentheses?

And people must really not like me, my user rating keeps getting voted down. lol. Out of curiosity, what allows you to vote on peoples user rating? I don't seem to have the ability.
Title: Re: New guy trying to spawn things
Post by: MrMedic on February 28, 2011, 09:06:16 pm
(http://i21.photobucket.com/albums/b270/tonyK1/screenie.jpg)

video :
http://www.youtube.com/watch?v=4UvpOcg3QQQ

i'l pm you the script , if anyone else wants it pm me.

video shows what it does.
Title: Re: New guy trying to spawn things
Post by: M. O. on March 01, 2011, 12:38:07 am
Lol, "why walk". Good music.