Forum Jump :

Author Message


Posts: 26
Rank:


Level: Member

Country: us
Location: Dallas, Tx
Occupation:
Age: 46
In-game name:

 
#1 Posted at 2012-03-25 15:14        
     
Any novice scripter will tell you they've used these commands several times, I myself, included...

But truth be told, I have the foggiest ideal what the heck I'm doing, in regards to the
CreateVehicle and CreateVehicleLocal commands. I wish that BIS would release more
indepth help, than just an example or two, they need to give us the valuable data as
well, such as when to use scripting commands, and when not to, not just HOW to...

Can someone explain to me when I should use CreateVehicle, and when I should use
CreateVehicleLocal. I'm always trying to improve the missions I make, by making
them more efficient. I NEVER create single player maps, only multiplayer maps,
so I guess it's important to know what gets created on my end, through my scripts,
and what needs to be sent to all computers?

Are there any others having this mental debate going on in their heads...

Am I using the right command? Should this be kinda local, REALLY local, public, or global?
Should this be sqs, sqf, or WGAF?

So many questions, it's amazing I can even get out of bed in the mornings. So when
it comes to asking for help, can I really devote any time to one particular question,
when all the questions are important. If only BIS would would the command descrepancies
relating to those statements that do not work, and under what circumstances do they work,
such as the MoveInCargo, etc, commands... Getting a freaking helicopter to land for God's
sake, without having to write 100 line script... Who chooses what commands to put in a game
and what commands to leave out? Al-Quida? You'd think they'd at least put a working landing
command in there.

And while I'm complaining... How bout some string functions? Yeah, throw in some garlic
salt as well, and some sage, lite on the onions please...

And please dear God, when Arma 3 comes out, assuming I get a computer to play it on within
my remaining life span, please force BIS to get rid of this stupid scripting language with
its tiresome select this, then that, select 3 nonsense.

I get a feeling I'm gonna get introuble for this post, and I was on such a role being
good... Okay, I think I got it out of my system...

Sorta Sincerely,

FullMetal (harold5187)

As many of us do, I as well, come from a Flashpoint, Resistance and Arma background. I was a member of the original DSF clan for about two months, back when Hatcher was in charge, along with Deaddog, Joker, Thatcher, two german dudes, and my callsign was, and still is FullMetal.

Author Message


Posts: 83
Rank:


Level: Member

Country: nz
Location: Wellington
Occupation: Game Designer
Age: 36
In-game name:

 
#2 Posted at 2012-03-25 16:09        
     
You can script in Java, as this is the "future" and is being supported by ToH and ArmA3.

Have you checked out the wiki? There are detailed descriptions of: createVehicle and createVehicleLocal

Not really much more to say than those articles really.

createVehicle creates your object, and then ensures ALL clients on the network create the vehicle on their side, and use the same reference. createVehicleLocal only creates the vehicle on that client, not on all others.

So, if I used createVehicle to make a HMMWV on my client while connected to a multiplayer game, that HMMWV would be visible and usable on all machines. If I used createVehicleLocal, it would only be visible and usable on MY machine. There are uses and advantages to both.

I don't share your thoughts on the criticisms of the scripting language as "stupid", every programming language utilizes control structures (if... then, while.. wend, select...). I'm not sure how one could write a program without such syntax. I'm not sure who Al-Quida is, did you mean Al-Qaeda? Many of the game's commands come from requests from users on the BI Forums.

I suspect your troubles stem from not using the BI community wiki, there is a wealth of knowledge about locality issues, and the commands themselves. If you struggle with basic concepts such as locality, control structures, and other aspects of programming then I am afraid no programming language will seem "smart" to you and they will all be "stupid".

An old proverb comes to mind... "a poor workman blames his tools" ;)


Advertisement


Author Message


Posts: 26
Rank:


Level: Member

Country: us
Location: Dallas, Tx
Occupation:
Age: 46
In-game name:

 
#3 Posted at 2012-03-25 16:41        
     
Ey, Rocket, thanks for your reply, I was just venting... Spent the previous wee hours of the morning
all the way till late night, trying to solve the ol' Pilot Bug, which I didn't discover was my
problem till the very end of that time.

The emotional state of that post wasn't really serious as far as when I was criticising BIS for
their scripting language, it serves it's purpose, though not as powerful as we would like it, you
are right, my lack of knowledge in this language frustrates me, but its no lack do to laziness, as
I have been using it since the early days of Flashpoint, then Resistance.

Before I even get on this website asking for help, means I've exhausted every other alternative; For me
it's quicker to go searching for the answer than to wait for a reply here, which may or may not come
in time, and I'm sure as great as a site this is, some of us can attest to times when we've really
needed some quick answers that didn't come as quickly as we needed. We work around those problems.

I'm not lazy, nor do I want others to do my scripting for me... I have two years in business programming
under my belt, with full knowledge of control structures, etc... So, I'm not lazy, or stupid... This is
just a hard scripting language with many irregularities, found less frequently in languages like C++, or
even Pascal as outdated as that is.

Anyway, thanks for your post, and don't take this post serious... My main conscern, was all I could find
on Createvehicle, and ...vehiclelocal, was the syntax of the statement, and that Createvehicle is used to
create an object seen on all computers, while ...vehiclelocal does the opposite, but what is not
explained is when you would want to create an object that is not seen on all computers.

Another... If I createvehiclelocal, say an "M1Abrams", does that mean that I'll be driving around an invisible
tank, that noone else sees, because it wasn't broadcast over the network? I understand how it's done, just
not when and where I should be conscerned with which.

Sincerly
FullMetal

As many of us do, I as well, come from a Flashpoint, Resistance and Arma background. I was a member of the original DSF clan for about two months, back when Hatcher was in charge, along with Deaddog, Joker, Thatcher, two german dudes, and my callsign was, and still is FullMetal.

Author Message


Posts: 83
Rank:


Level: Member

Country: nz
Location: Wellington
Occupation: Game Designer
Age: 36
In-game name:

 
#4 Posted at 2012-03-25 17:07        
     
No problem! we all need to vent :)

In answer to your question, yes - if you createVehicleLocal a tank, you will be driving around in an invisible tank!

Many people use the command for ammo containers, and then spawn in weapons particular to that character. In that situation, each player has their "own" ammo crate that is created with createVehicleLocal. The object exists locally on that persons machine, nobody else can access/see it.

What's the pilot bug you are experiencing? I might be able to help.


Author Message


Posts: 26
Rank:


Level: Member

Country: us
Location: Dallas, Tx
Occupation:
Age: 46
In-game name:

 
#5 Posted at 2012-03-26 01:04        
     
I got your message, the Pilot Bug, as it's been called by others, is when you've created a vehicle, and pilot,
then tell the pilot to get into the vehicle via the MoveInPilot command, later on, many people including myself have
had issues, with not being able to get other teammates under our squad to assignascargo, at that point the other AI
will not even MoveInCargo either. They will appear to try, but appears they get ejected out for some reason.

I fixed my version, by removing the MoveIn... commands. I notified Foxhound that the issue
had been resolved.

Turns out, when you tell a soldier to MoveInPilot, via scripts, the pilot doesn't even know he's in a vehicle,
because that command does not assign him to any particular slot, it just teleports him into that position.

That bug cost me nearly 10-12 hours of code chasing, but I'll know to avoid that command next time.

I'm glad it happened, because along the way I learned a few new things I never knew, and began using
those ideals in my current mission. Combat101, I havn't updated the Minimal Addons version, only the
version me and my friend use. But soon, I'll post an update. I found several bugs along the way I have
to correct in the posted version.

I'll keep checking back, but probably won't be till tommorrow... Gonna watch some Star Trek for a bit...

Stay Cool,
FullMetal

As many of us do, I as well, come from a Flashpoint, Resistance and Arma background. I was a member of the original DSF clan for about two months, back when Hatcher was in charge, along with Deaddog, Joker, Thatcher, two german dudes, and my callsign was, and still is FullMetal.

Author Message

palyarmerc  

I live inside the editor


Posts: 753
Rank:


Level: Member

Country: uk
Location:
Occupation: *Retired from ArmA*
Age:
In-game name: Paly

 
#6 Posted at 2012-03-26 16:19        
     
I liked your code _Unit action ["getIncargo",_HVEH];, not seen it before, and will use it in some areas, but I when I tried it briefly and they did not moveTo the destination...I need my troops to visually move to, and get in, the vehicle (as they can be seen by the player) so it didn't work for me...I liked it though, and will use it in some areas

P.S -- scripting Vehicles and Cargo is nothing compared to getting Sounds and Radio Messages, Hints etc, or Cutscenes to transmit across the network

This post was edited by palyarmerc (2012-03-26 20:29, ago)

....that's all folks....!

Author Message


Posts: 83
Rank:


Level: Member

Country: nz
Location: Wellington
Occupation: Game Designer
Age: 36
In-game name:

 
#7 Posted at 2012-03-27 07:26        
     
Most locality issues can be solved using the Multiplayer Framework commands.

For example, to have a hint message appear on all clients:

[nil,nil,rHINT,"Enjoy the game."] call RE;

You need to make sure the "Functions" module is present on the map for these to work however.