View unanswered posts | View active topics It is currently Thu Mar 28, 2024 5:50 pm



Reply to topic  [ 6 posts ] 
 Gun Script Help ( No Experience) 
Author Message

Joined: Fri Oct 26, 2012 5:45 am
Posts: 4
Reply with quote
Post Gun Script Help ( No Experience)
Hey guys,

So, I was interested in learning Lua, but have no background in scripting whatsoever. I was wondering if anyone could help me script a basic gun (sprite) that I have made. I was wondering if someone could teach me how to script it to shoot, how to locate the files, etc. Any help would be amazing, even the slightest bit. Remember, im not trying to actually make a mod, just learning how to script a gun so i can use it in the game!


Attachments:
File comment: Super simple gun
Cgun.png [1.22 KiB]
Not downloaded yet
Fri Oct 26, 2012 5:53 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Gun Script Help ( No Experience)
From what I can read, it seems like you want to code a gun that doesn't require lua, just a weapon that you can create by yourself and use in-game.

Well, a long time ago I created a file that explained each variable in a simple way.

Attachment:
Nuevo documento de texto (2).txt [13.82 KiB]
Downloaded 351 times


Check it, it's a machine gun with all the variables explained and a link to Azukki's guide to offset determination.


Fri Oct 26, 2012 9:32 pm
Profile

Joined: Fri Oct 26, 2012 5:45 am
Posts: 4
Reply with quote
Post Re: Gun Script Help ( No Experience)
Thanks for the document. But what im looking for is just simply how to add a gun to the game for fun. I've sorta got all of the meanings of things, I just want to know how to piece it together :D


Sat Oct 27, 2012 2:51 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Gun Script Help ( No Experience)
Well, to add a gun to the game, you must define it inside a module (a folder that ends with .rte).

It can be either your own create module, or a vanilla one, though if you want to release it as a mod, it would be better to create your own.

Anyway, so, to create it, grab any file that is read by the engine (like, for example, the Coalition's Index.ini) and type in your gun. Define the round, the mag, the HDFirearm, and you should be ready to go! Just remember to add Buyable = 1 and AddToGroup = Weapons and that jazz.

If that doesn't answer your question, don't doubt on asking again.


Sat Oct 27, 2012 3:31 am
Profile
User avatar

Joined: Tue Aug 09, 2011 11:43 am
Posts: 7
Reply with quote
Post Re: Gun Script Help ( No Experience)
@Slendamon

There isn't any magic button to make your sprite to a working gun, but with Asklar's awesome guide and modding templates and little effort you should have your gun working in no time.

Once you got the template you should move your sprite into the Gun Template.rte and either rename your sprite the same as the one's in the template, or preferably change the paths in the Gun.ini to match your sprite (ie. Gun Template.rte/Images/Gun.bmp -> Gun Template.rte/Images/MyGunSpriteWhateverTheNameIs.bmp). Use Asklar's guide to start experimenting with different values and make the gun like you want it.

This is propably the simplest way to create a modifiable gun without messing anything up with official content.


Sat Oct 27, 2012 1:02 pm
Profile

Joined: Fri Oct 26, 2012 5:45 am
Posts: 4
Reply with quote
Post Re: Gun Script Help ( No Experience)
Thanks all for the help. Finally figured it out!


Sat Oct 27, 2012 7:01 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.076s | 20 Queries | GZIP : Off ]