Weapon question

Topics regarding Scripting with Reality Factory
Post Reply
planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Weapon question

Post by planebus » Fri Feb 19, 2010 1:44 pm

Code: Select all

;
; Pawn.ini
;
; defintion of all pawns goes here
;

;conversation defines

[Conversation]
background = conva4.bmp
backgroundalpha = a_conva4.bmp
iconx = 0
icony = 0
speachx = 22
speachy = 20
speachwidth = 730
speachheight = 155
speachfont = 10
replyx = 22
replyy = 20
replywidth = 730
replyheight = 155
replyfont = 10
replymenufont = 10
replymenubar = menuconv.bmp
replymenubaralpha = a_menuconv.bmp
replybackground = conva4.bmp
replybackgroundalpha = a_conva4.bmp
speachwindowx = 10
speachwindowy = 10
replywindowx = 10
replywindowy = 440
giffile1 = menu\arrow.gif
;giffile2 = 
;giffile3 = 
;giffile4 = 
;giffile5 = 
;giffile6 = 
;giffile7 = 
;giffile8 = 
;giffile9 = 
gifx = 10
gify = 10 

[camera]
actorname = Projectile\proj.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = false
boundingboxanimation = nocollide
shadowsize = 0

[Virgil]
actorname = Virgil_red.act
actorrotation = -90 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = Idle
shadowsize = 30

[robot]
actorname = robot.act
actorrotation = 0 90 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle

===
; pawn weapons
;===

[M16_bot]
[b]actorname = m16_bot.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
type = weapon
environmentmapping = false
allmaterial = false 
percentmapping = 75
percentmaterial = 75[/b]
when I add those Bold characters, namely defind a weapon in pawn.ini file,
I run the game, it pop up a message box
"RealityFactory has stopped working
A problem caused the programm.....
"
How do I handle this problems
Thx

planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Re: Weapon question

Post by planebus » Fri Feb 19, 2010 1:45 pm

this word is added at the end of files

[M16_bot]
actorname = m16_bot.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
type = weapon
environmentmapping = false
allmaterial = false
percentmapping = 75
percentmaterial = 75

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

Re: Weapon question

Post by QuestOfDreams » Fri Feb 19, 2010 2:32 pm

Make sure that there are some empty lines at the end of your ini file.

planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Re: Weapon question

Post by planebus » Fri Feb 19, 2010 4:27 pm

Yes, I am sure there are some emply line at the end of file

planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Weapon

Post by planebus » Sat Feb 20, 2010 10:48 am

friends, I am exhausted about this question.
I added a weapon which denoted by Bold letters, since I run the game, it will pop up a error mesage box
" RealityFactory has stopped working A problem caused the programm....."
Can anyone show me the way,
BTY, can anyone who has some guide about RF can share with me,
Thanks

my pawn.ini file
;
; Pawn.ini
;
; defintion of all pawns goes here
;

;conversation defines

[Conversation]
background = conva4.bmp
backgroundalpha = a_conva4.bmp
iconx = 0
icony = 0
speachx = 22
speachy = 20
speachwidth = 730
speachheight = 155
speachfont = 10
replyx = 22
replyy = 20
replywidth = 730
replyheight = 155
replyfont = 10
replymenufont = 10
replymenubar = menuconv.bmp
replymenubaralpha = a_menuconv.bmp
replybackground = conva4.bmp
replybackgroundalpha = a_conva4.bmp
speachwindowx = 10
speachwindowy = 10
replywindowx = 10
replywindowy = 440
giffile1 = menu\arrow.gif
;giffile2 =
;giffile3 =
;giffile4 =
;giffile5 =
;giffile6 =
;giffile7 =
;giffile8 =
;giffile9 =
gifx = 10
gify = 10

[camera]
actorname = Projectile\proj.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = false
boundingboxanimation = nocollide
shadowsize = 0


[robot]
actorname = robot.act
actorrotation = 0 90 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle

[Virgil]
actorname = Virgil_red.act
actorrotation = -90 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = Idle
shadowsize = 30

[v_minigun]
actorname = v_minigun.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
type = weapon
environmentmapping = true
allmaterial = true
percentmapping = 75
percentmaterial = 75

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

Re: Weapon question

Post by QuestOfDreams » Sat Feb 20, 2010 6:05 pm

Is there any error message in the RealityFactory log file?
The v_minigun.act file is usually located in the subdirectory "Weapon" which you did not specify.
Also, v_minigun.act is a 1st person weapon actor - you should use p_minigun.act if you want to attach it to Virgil.
BTY, can anyone who has some guide about RF can share with me
What kind of guide do you need? There's a complete manual that comes with RF and you can download an ebook that walks you through the process of creating a whole game with RF ...

PS: Don't create more than one topic for the same question. This goes against the board posting rules.

planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Re: Weapon question

Post by planebus » Sun Feb 21, 2010 9:19 am

thanks with millions^_^

So I modify our pawn.ini to add a weapon with the following lines, and there is no error message box pop up again
[p_minigun]
actorname = Weapon\p_minigun.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
type = weapon
environmentmapping = true
allmaterial = true
percentmapping = 75
percentmaterial = 75

In my script, I also write down those codes to setweapon, but my Virgil does not still hold the gun, so what should I do?
Spawn[ ()
{
Console(true);
SetWeapon("p_minigun");
NewOrder("start");
} ]

IndigoWraithe
Posts: 13
Joined: Fri Feb 19, 2010 1:28 am

Re: Weapon question

Post by IndigoWraithe » Wed Mar 03, 2010 1:06 am

*edit: i also discovered that the scale number must also be equal to the scale number of your character. many of the actors are scaled to 1.4, so please be sure to have your scale set to the appropriate number.

i suggest you download the ebook and go to the section about adding weapons. It has an in-depth, step-by-step tutorial on how to add a new weapon to your game. i haven't started adding weapons yet, so i can't tell you off the top of my head and I'm not at home right now, so i don't have the file with me. someone posted a link a little further up, or just go to the downloads section and you can find it there.

as i recall, you have to run a new level in reality factory to do weapon positioning, but im not sure.

Post Reply