Jump to content
Ranwer135

Scripting Introduction for New Scripters

Recommended Posts

There something I'm just over looking please anyone help me find out why the mission after restart just restarts again it's like the timer still thinks it's at 0. How would I go about fixing this problem? The last script is where the error is.
sRestartWarnings.sqf

 

Have a look at my Topic:

 

If I can get this to work Linux user's may have a way to send warnings about a restart and execute with this all in one addon script.

Share this post


Link to post
Share on other sites

Very nice of you to provide an entry into scripting for the beginners. Kudos.

Also to throw in the classic quote from Knuth, "Premature optimization is the root of all evil." Solve the problem first, however you can, then optimize where possible. Getting caught up in implementation details before you even have anything implemented or designed is completely idiotic. Also, shame on those who are trying to "one-up" each other on the forums to fulfill their superiority complex.

 

A suggestion to those posting very specific problems: create a separate thread. I imagine Ranwer created this guide as an introduction to scripting, and not as a thread for everyone to spam problems that are way over their heads. Start small, and keep practicing. Learning to code is a lengthy process (takes years to become fluent), don't bite off more than you can chew.

 

Peace out and good luck!

  • Like 2

Share this post


Link to post
Share on other sites

Hello guys!
I maded a mission in editor using scripts. I made a dialogue between the soldiers, and an intro text, when the mission start. It works perfectly in editor, BUT after I export to SP mission, it says: text1.sqf missing. And after that,  there is no communication during the mission. I used for dialogue an another script (chat1.sqf), it doesnt say any error, jsut simple not work.

Can you tell me, how can i modify my script, to work in SP?

Share this post


Link to post
Share on other sites

Hello guys!

I maded a mission in editor using scripts. I made a dialogue between the soldiers, and an intro text, when the mission start. It works perfectly in editor, BUT after I export to SP mission, it says: text1.sqf missing. And after that,  there is no communication during the mission. I used for dialogue an another script (chat1.sqf), it doesnt say any error, jsut simple not work.

Can you tell me, how can i modify my script, to work in SP?

I think this topic is thought as Introduction for beginners and should not hijacked to solve problems.

raise ur post count by creating sensefull posts and then u can create ur own topic for ur problem.

If u r able to create a topic then be more specific with ur question and probably post some of ur code or nobody could be able to help u with it.

Share this post


Link to post
Share on other sites

I think this topic is thought as Introduction for beginners and should not hijacked to solve problems.

raise ur post count by creating sensefull posts and then u can create ur own topic for ur problem.

If u r able to create a topic then be more specific with ur question and probably post some of ur code or nobody could be able to help u with it.

Okay, I appriceate your advice, but if you wanna give me real help, please check this topic. I dont find more relevant tahn this.

https://forums.bistudio.com/topic/189295-why-some-scripts-works-pretty-good-in-some-missions-and-in-others-dont/?hl=script+work

Share this post


Link to post
Share on other sites

Hey guys, what exact arguments I'm missing? the RPT is telling me that 0 elements are provided and 3 expected but I have them?!

objectPos = format ["%1", (nearestObjects [getPos object, ["Land_HistoricalPlaneWreck_01_F"], 6000]) ];

Share this post


Link to post
Share on other sites

 

Hey guys, what exact arguments I'm missing? the RPT is telling me that 0 elements are provided and 3 expected but I have them?!

objectPos = format ["%1", (nearestObjects [getPos object, ["Land_HistoricalPlaneWreck_01_F"], 6000]) ];

 

1. wrong thread

 

2. show us where 'object' is defined as a variable. from this line alone, the engine may be going:     getpos ??????? when it gets to that line. object is probably a bad variable name too. call it something else

Share this post


Link to post
Share on other sites

Hello guys, i just wanted to make a suggestion that is basicly for beginners.

 

How about a FAQ, like "Whats the difference between createAgent and createUnit". or "how to make a heli land". Yes there is a search function, several tutorials and stuff. but honestly, a faq would be really useful for beginners.

Share this post


Link to post
Share on other sites

Hi guys, new here and new in Arma scripting. Just wanted to say thank you for your time and for sharing all those knowledge with ppl willing to learn.

Share this post


Link to post
Share on other sites

Yo, New here trying to ask for help :)

Oh god! This is not an introduction thread for new scripters, this is thread for introducing scripting to new scripters  :face_palm:

  • Like 5

Share this post


Link to post
Share on other sites

Hi this is off topic but i dont know where else to ask. Why cant i post a threat yet? (new account) 9 days old

Share this post


Link to post
Share on other sites

Hi this is off topic but i dont know where else to ask. Why cant i post a threat yet? (new account) 9 days old

 

Per the Rules:

 

 

 

New accounts are not able to create new threads right away and have limited access to certain functions for an undisclosed trial period. Try participating with the community, reply to other posts in either an inquisitive or constructive way.

 

If you have a question it's really best to just ask the question rather than asking why you can't ask the question.

Share this post


Link to post
Share on other sites

I'm relatively new to making scripts for my missions, this helped out a fair bit, thank you :)

Share this post


Link to post
Share on other sites

Hi guys im trying to get the Medium conrete wall (gate) to open when triggered ive tried everything and to be honest its starting to trigger me haha My bar gate opens with BG_1animate ["Door_1_rot",1] but i canot find a similar script that will open this sliding concrete gate any help pleeeeeeeease.

Share this post


Link to post
Share on other sites

Hi there,
I am new to scripting and have figured out a lot of stuff already. Currently i am making a mission that is supposed to have loot spawning.
For this i am using a script that i found online and it works so far exept that i keep getting an error message when i am close to
new houses. The error message is this:

 

https://www.dropbox.com/s/d91ct0q50ovhmki/Screenshot.jpg?dl=0

Strangely everything seems to work though. The code in question is the following:

while {true} do {
_localpos = position player;

 _housenear= getPos player nearObjects ["House",50];
 //_house=_housenear select 0;
 _position = _house buildingpos 1;                      // this is line 15
_loot = "Box_IND_Grenades_F" createVehicle _position;
_loot allowdamage false;

 

I hope you guys can help me and i hope that this post is in the right category as well.
Thanks a lot and have a good one!
All the best.
CamouflageKitten

Share this post


Link to post
Share on other sites

Hi there,

I am new to scripting and have figured out a lot of stuff already. Currently i am making a mission that is supposed to have loot spawning.

For this i am using a script that i found online and it works so far exept that i keep getting an error message when i am close to

new houses. The error message is this:

 

https://www.dropbox.com/s/d91ct0q50ovhmki/Screenshot.jpg?dl=0

Strangely everything seems to work though. The code in question is the following:

while {true} do {

_localpos = position player;

 _housenear= getPos player nearObjects ["House",50];

 //_house=_housenear select 0;

 _position = _house buildingpos 1;                      // this is line 15

_loot = "Box_IND_Grenades_F" createVehicle _position;

_loot allowdamage false;

 

I hope you guys can help me and i hope that this post is in the right category as well.

Thanks a lot and have a good one!

All the best.

CamouflageKitten

Hi. Remove double line from  //_house=_housenear select 0;

This error says about a non-existent variable _house, because you comment her.

Share this post


Link to post
Share on other sites

How do you write a double nested for loop ? I can not write the simplest one. My google fu has not yet found an example.

Share this post


Link to post
Share on other sites


for "_i" from 1 to 10 do {

    for "_j" from 1 to 10 do {

        diag_log format ["%1,%2",_i,_j]

    };

};

  • Like 1

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

×