wepon

Topics regarding Scripting with Reality Factory
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Sat Jun 18, 2011 12:23 am

is there a video tutorial of somthing that teaches me how to script a gun. video tutorial is better than a reading tutorial

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Sat Jun 18, 2011 5:10 am

Reality Factory barely has any video tutorials and they have no tutorials onscripting a gun. The making 3d games in Reality factory is no help. Is there a video tutorial

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Mon Jun 20, 2011 2:51 am

is it possible that once a week someone can teach me how to script wepons like a trainer

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Wed Jun 22, 2011 3:20 am

how do i disable the 3d person view in the control.ini mabey than this script will work.

anyways is there any errors in this script

;*********************************************************
; Mp40
;*********************************************************
[Mp40]
type = weapon
slot = 1
firerate = 0.01
catagory = projectile
projectile = pistol_shell
attribute = enemy_health
ammunition = pistol_shell
ammopershot = 1
shotpermagazine = 30
attacksound = Weapon\hmg.wav
reloadsound = Weapon\dryfire_rifle.wav
emptysound = Weapon\rifle_reload.wav
muzzleflash3rd = MuzzleFlash
;
; 1st person
;
viewactor = Weapon\Mp40.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = -53.8 90.3 3.2
viewoffset = 0.7 -38.80 6.0
viewscale = 0.61
viewlaunchoffset = 0 0 25
viewlaunchbone = Bip01 R Hand
viewanimationspeed = 1
viewarmanim = idle
viewidleanim = idle
viewattackanim = idle
viewaltattackanim = idle
viewhitanim = idle
viewalthitanim = idle
viewwalkanim = idle
muzzleflash = MuzzleFlash1
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = false
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
zoomamount = 2
zoomoverlay = zoomlow.bmp
zoomoverlayalpha = a_zoomlow.bmp
allowzoommove = false
recoilamount = 10
recoildecay = 5
bobamount = 10
viewreloadanim = idle
viewkeyreloadanim = idle
viewattackemptyanim = idle
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0
;
; 3rd person
;
playeractor = Weapon\Mp40.act

playerfillcolor = 128 128 128
playerambientcolor = 128 128 128
playerrotation = -90 180 0
playerscale = 1
playerlaunchoffset = 0 0 25
playerbone = BIP01 R HAND
;
; dropped weapon
;
dropactor = Weapon\Mp40.act
dropfillcolor = 255 255 255
dropambientcolor = 255 255 255
droprotation = 0 -90 0
dropoffset = -40.0 -60.0 35.0
dropscale = 2.0
dropgravity = false
drophidefromradar = true

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: wepon

Post by QuestOfDreams » Wed Jun 22, 2011 9:54 pm

I really hate to quote myself ...
how do i disable the 3d person view in the control.ini
QuestOfDreams wrote:Read the manual!
That's what is was written for. :!:
mabey than this script will work.
No, and I have already told you why:
QuestOfDreams wrote:3rd person weapon actors must have the same skeleton as the 3rd person player actor.
QuestOfDreams wrote:Furthermore that actor has no animation named idle.
QuestOfDreams wrote:If you still want to use that actor as 1st person weapon you will have to check which animations it has (use the ActView tool for that) and specify them in the weapon.ini file (where it now says idle).
How to adjust the rotations and offsets of 1st person weapons is described in the manual in detail.
These should be enough hints for you to properly define a weapon. I won't write the correct definition here, as you won't learn anything if I'd do and you'll be stuck with the same problem again next time.

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Wed Jun 22, 2011 10:00 pm

thanks quest. Its a good idea. I want to figure out the code myself. This is a good idea. ill read it again. Also i disabled 3rd person view which be support. thanks quest :D

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Thu Jun 23, 2011 12:04 am

since i disabled 3rd person view do i still need the 3rd person script?

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Fri Jun 24, 2011 6:22 pm

hi I have a script like this for my weapon. do i need it and where do i save it. its supposed to go with my weapon.

Code: Select all

{

IDLE      [gun_idle]
SHOOT  [gun_shoot]

OFFSET_Y     [75]

FIRERATE      [0.5]
PROJECTILE  [bullet]
FIREBONE     [firebone]
DAMAGEATTRIBUTE  [health]


firetimer [0]

Spawn[ ()
{
Gravity(false); // we don't want the gravity to affect this pawn
SetNoCollision(); // Don't collide with anything

LowLevel("setup_lowlevel");   // go to low level
} ]

setup_lowlevel[ ()
{
self.ThinkTime = 0;

self.yaw_speed = 10000;  // make sure the pawn rotates fast enough
self.pitch_speed = 10000;

AnimateHold(IDLE);  // play the idle animation
self.think = "idle";  // start executing "idle" order
} ]


idle[ ()
{
self.ThinkTime = 0;  // execute this order every frame

if(self.animate_at_end)  // if animation has finished, play it again
{
     AnimateHold(IDLE);
}

PositionToPlayer(0,OFFSET_Y,0,false,false);  // move with the player

self.ideal_yaw = self.player_yaw;  // get the ideal rotation
self.ideal_pitch = self.camera_pitch;

ChangeYaw();    // rotate to match the rotation defined above
ChangePitch();

if(self.lbutton_pressed and (firetimer < self.time))  // if left mouse button is pressed and enough time has passed since the last shot
{
     firetimer = self.time + FIRERATE;  // set the delay to next shot
     FireProjectileBlind(PROJECTILE,FIREBONE,0,0,0,DAMAGEATTRIBUTE);  // shoot the projectile
     AnimateHold(SHOOT);  // play the shooting animation
}
} ]

}

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: wepon

Post by QuestOfDreams » Fri Jun 24, 2011 8:16 pm

since i disabled 3rd person view do i still need the 3rd person script?
Remove the definitions for the 3rd person weapon (the ones starting with player). Even better than disabling the 3rd person view via the control.ini file would be to force the viewpoint of this specific weapon to 1st person view by adding the forceviewto option to the weapon definition in the weapon.ini file (i.e. forceviewto = firstperson, see manual for details).
hi I have a script like this for my weapon. do i need it and where do i save it. its supposed to go with my weapon.
You only need a script for a weapon if you want to have a different behaviour than the built in weapons provide. A "scripted weapon" in fact would mean that you will be using a Pawn as weapon.

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Fri Jun 24, 2011 8:44 pm

quest i disabled it from the control.ini so yeah. Which part do i read in the manual i was looking.

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Fri Jun 24, 2011 9:35 pm

i disabled the 3rd person view from the control.ini and camera.ini. Now would this script work. Also i removed tje 3rd person from the weapon.ini. Anyways heres my code

Code: Select all

;*********************************************************
; Mp40
;*********************************************************
[Mp40]
type = weapon
slot = 1
firerate = 0.01
catagory = projectile
projectile = pistol_shell
attribute = enemy_health
ammunition = pistol_shell
ammopershot = 1
shotpermagazine = 30
attacksound = Weapon\hmg.wav
reloadsound = Weapon\dryfire_rifle.wav
emptysound = Weapon\rifle_reload.wav
muzzleflash3rd = MuzzleFlash
;
; 1st person
;
viewactor = Weapon\Mp40.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = -52.0 82.0 4.0
viewoffset = 0.7 -38.80 6.0
viewscale = 0.61
viewlaunchoffset = 0 0 25
viewlaunchbone = Bip01 R Hand
viewanimationspeed = 1
viewarmanim = idle
viewidleanim = idle
viewattackanim = idle
viewaltattackanim = idle
viewhitanim = idle
viewalthitanim = idle
viewwalkanim = idle
muzzleflash = MuzzleFlash1
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = false
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
zoomamount = 2
zoomoverlay = zoomlow.bmp
zoomoverlayalpha = a_zoomlow.bmp
allowzoommove = false
recoilamount = 10
recoildecay = 5
bobamount = 10
viewreloadanim = idle
viewkeyreloadanim = idle
viewattackemptyanim = idle
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: wepon

Post by paradoxnj » Fri Jun 24, 2011 10:37 pm

How about looking at Page 81 of the ebook? It explains what you are trying to do step by step. Page 90 and 91 explain first person weapons also.
Many Bothans died to bring you this signature....

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: wepon

Post by QuestOfDreams » Fri Jun 24, 2011 11:09 pm

You still have to
check which animations it has (use the ActView tool for that) and specify them in the weapon.ini file (where it now says idle).

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Fri Jun 24, 2011 11:15 pm

how do I specify in the actor view. Also how did the c8 become a weapon with no motion and little skelation with animation.

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: wepon

Post by megatop » Sat Jun 25, 2011 4:19 am

i deleted the 3rd person view for my weapon in the weapon.ini and deleted 3rd person view in the control.ini and the camera.ini heres my new code. Also do I need the dropped weapon script. heres my code

Code: Select all

;*********************************************************
; Mp40
;*********************************************************
[Mp40]
type = weapon
slot = 1
firerate = 0.01
catagory = projectile
projectile = pistol_shell
attribute = enemy_health
ammunition = pistol_shell
ammopershot = 1
shotpermagazine = 30
attacksound = Weapon\hmg.wav
reloadsound = Weapon\dryfire_rifle.wav
emptysound = Weapon\rifle_reload.wav
muzzleflash3rd = MuzzleFlash
;
; 1st person
;
viewactor = Weapon\Mp40.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = -53.8 90.3 3.2
viewoffset = 0.7 -38.80 6.0
viewscale = 0.61
viewlaunchoffset = 0 0 25
viewlaunchbone = Bip01 R Hand
viewanimationspeed = 1
viewarmanim = idle
viewidleanim = idle
viewattackanim = idle
viewaltattackanim = idle
viewhitanim = idle
viewalthitanim = idle
viewwalkanim = idle
muzzleflash = MuzzleFlash1
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = false
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
zoomamount = 2
zoomoverlay = zoomlow.bmp
zoomoverlayalpha = a_zoomlow.bmp
allowzoommove = false
recoilamount = 10
recoildecay = 5
bobamount = 10
viewreloadanim = idle
viewkeyreloadanim = idle
viewattackemptyanim = idle
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0
;
; dropped weapon
;
dropactor = Weapon\Mp40.act
dropfillcolor = 255 255 255
dropambientcolor = 255 255 255
droprotation = 0 -90 0
dropoffset = -40.0 -60.0 35.0
dropscale = 2.0
dropgravity = false
drophidefromradar = true







Also do I need to delete the 3rd person in the player.ini

Post Reply