More n00b questions :)

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.
Howdy all.
I'm new to coding unrealscript, but since i have experience with java the learning curve is not too steep. I am coding for a mod with a group of mates working on the other parts like mapping , music, modelling etc. I have a few questions i need answered.

1) How can i increase/decrease the accuracy of a weapon? I am making an Ingram Mac10 at the moment, and as practise i subclassed the enforcer and greatly increased its firing rate. Its actually almost perfect for what i wanted except its too damn accurate! How can i tone it down?

2) How can i make an aiming reticle come up when alt fire is pressed on a weapon ala Operation Flashpoint when u look down the sights on the M16?

3) Since im the coder its expected that i import all the models so how is it done. I have 3ds2unr and some models in 3ds format. Do i need to put arms and hands on the model or is there some way to use UT's ones?

Cheers
 

Shiit

Shiit
Dec 19, 2000
168
0
0
1.

Code:
function Fire(float Value)
{
	if ( AmmoType == None )
	{
		// ammocheck
		GiveAmmo(Pawn(Owner));
	}
	if ( AmmoType.UseAmmo(1) )
	{
		GotoState('NormalFire');
		bCanClientFire = true;
		bPointing=True;
		ClientFire(value);
		if ( SlaveEnforcer != None )
			Pawn(Owner).PlayRecoil(2 * FiringSpeed);
		else if ( !bIsSlave )
			Pawn(Owner).PlayRecoil(FiringSpeed);
		TraceFire(0.2);
	}
}

See that TraceFire over there? The 0.2 is the accuracy. Just change this value wherever Tracefire is called. Remember that the higher this value is, the more inaccurate it gets. Check out the Tracefire function in the Weapon class. As you can see, bullets spray out 45deg in all directions when you use an accuracy of 20.

2. Uhm... Not really sure. Kinda like the Sniper Rifle in UT? Check out it's code.

3. You mean the hands that you see when holding a gun? They're part of the gun's model, so you won't have to bother with those. As for the importing, I'm not quite sure. I posted the same question some time earlier, but didn't get a reply.
 

Raeled

Feuer Frei!
Jul 1, 2001
161
0
0
40
Dordrecht, The Netherlands
Visit site
2.

Every weapon get's the change to draw some it's own stuff on the HUD in the PostRender( canvas Canvas ) function.

you can also set bownscrosshair of the weapon to true, if you don't want the HUD to draw a crosshair for your weapon.
 

RegularX

Master of Dagoth Lies
Feb 2, 2000
1,215
0
0
Chicago, IL
well, wotGreal and some other UScript editors have exporters which will export out the original models. That might get them started.



rgx
 

gor

New Member
Dec 30, 2001
40
0
0
AUS
Visit site
Importing models:

Ok if you have your models in MAX all nicely setup with texture mapping and centred within a 250x250 bounding box then all you need to do is firstly; export the model from MAX (I use the exporter plugin - attached below) into mymodelsnamed_.3d and mymodelsnamea_.3d - when exporting and it says animation frames I dont put anything and just press ok...

Right so now you have the model files and the texture and any sounds right:

so in your UT folder create a folder with the name you want the package to be called ex: myflashgun so c:\ut\myflashgun ok.

Inside that make 2 folders. One called Models one called Classes.
put the models in the models and put the texture in there aswell.

get Your import script and put it in the classes folder.

* for examples - check out all of UT's wepaons and pickups and decorations etc.. and then either write your own or modify one to suit your needs...

.. then in your system folder theres your UT.ini file..
ok go find the section where it lists the
EDIT PACKAGES=.............. <--- the name you chose your folder earlier..

right now opn up dos and go to Ut system folder and type : ucc make

- youll find you now have a .u file in the system folder which you can now load in the ed etc..


Well thats a brief run through : The tutes where I learnt this are no longer available so sorry I cant point you anywhere.
 
cheers

when u say import script, do u mean the #exec import ones?
if i have a model i wanna see ingame with no animations can i still export to UT and use it? will it have a spit if i try and fire the weapon with no animation or will it just do nothing and shoot stuff without showing it?
 

arcanex

teh grinning totem
Sep 28, 2001
123
0
0
Yeah, you can put the anim-free model ingame and use it for your 1st person view, but you need to change the code so that it doesn't use any playanim() or else it'll freeze it up, I think.