My first script, and a problem

Topics regarding Scripting with Reality Factory
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

My first script, and a problem

Post by Ryan »

So here is my first script i wrote up. Its a kinda modified idler.s from andy's coding kitchen.

{

Spawn{ ()

{

PlayAnimation ("idle", "footstep.wav");

RestartOrder();

} ]

}

For some reason, the script is'nt working. The pawn wont even show up in the the RF edit pro. Did i do somthing wrong??
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

change
PlayAnimation ("idle", "footstep.wav");
to
PlayAnimation ("idle", true, "footstep.wav");
and
Spawn{ () <--bracket!
to
Spawn[ ()
plus check
SpawnOrder = Spawn(or the first order you want to start)
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

Ok, i fixed that script the way you told me, and I was able to get the model to show up in the level editor. But now it crashes whenever i try to test the level. I looked in my log, and it says there is a problem finding the footsteps.wav. The file directory is right though. :?:
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

hm..... you have footstep.wav in the audio folder right? not i any subfolders like footsteps?
try footsteps\footstep.wav
or changing it to a new sound completely
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

ok, ill try that.

I also wanted to run somthing past all you guys. I kinda went through some of the ebook scripting chapters, and I wrote out some definitions of what each line means, just to help me learn cause i find writing somthing out, and puting it into my own words, helps me understand somthing. :lol:

Anyhoo, heres what i have:

{

Spawn[()

{

Console(true);

AttributeOrder("health",100,"die"); //Determine the pawns health/what happens when runs out of health

FindTargetOrder(200,"alert","health"); //200, how far pawn can see,

SetFOV(360); //Pawn Sees all around

HostilePlayer(true); //Means that anything it sees is automaticall targeted as an enemy

Hostilesame(false); //Means the pawns same (another pawn) will not be targeted as enemy

HostileDifferent(false); //Means same as "hostilesame" except for a different type of pawn

Setgroup(enemy); //Gives the pawn/group a name "enemy" is the pawns name

}]



Die[() //New order thus the {()

{ //Starts the new order that was defined above

Remove(true); // This is the reaction that happens when the "die" order is run

}] //Ends the oder

}



Do most of my definitions appear to be what each line means or does?
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

Ryan wrote:ok, ill try that.

I also wanted to run somthing past all you guys. I kinda went through some of the ebook scripting chapters, and I wrote out some definitions of what each line means, just to help me learn cause i find writing somthing out, and puting it into my own words, helps me understand somthing. :lol:

Anyhoo, heres what i have:

{

Spawn[()

{

Console(true);

AttributeOrder("health",100,"die"); //Determine the pawns health/what happens when runs out of health

FindTargetOrder(200,"alert","health"); //200, how far pawn can see,

SetFOV(360); //Pawn Sees all around

HostilePlayer(true); //Means that anything it sees is automaticall targeted as an enemy

Hostilesame(false); //Means the pawns same (another pawn) will not be targeted as enemy

HostileDifferent(false); //Means same as "hostilesame" except for a different type of pawn

Setgroup(enemy); //Gives the pawn/group a name "enemy" is the pawns name

}]



Die[() //New order thus the {()

{ //Starts the new order that was defined above

Remove(true); // This is the reaction that happens when the "die" order is run

}] //Ends the oder

}



Do most of my definitions appear to be what each line means or does?
uppercase
AttributeOrder("health",100,"die");
to
AttributeOrder("health",100,"Die");
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

I have yet another problem :oops:

I have the script>

{

Spawn[()

{

Console(true);

AttributeOrder("health",20,"Die");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HostileDifferent(false);
SetGroup("Enemy");

}]


Die[()

{

Remove(true);

}]

}


The enemy pawn is supose to die after 20 health is removed. I tried the level, (using 2 different actors) and both of the actors did'nt die like they were supose to. The console did show up in the corner of the screen though. Did i make another capitlization error?

Note: I am using the tutorial from the ebook.
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

the enemy is using the attribute called health from
AttributeOrder("health",20,"Die");
make sure ur weapons damage the attribute health
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

WOW, that was a fast reply!

How do i check my weapons out?
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

the weapon.ini file in the install folder
like so
;*********************************************************
; mac10
;*********************************************************
[mac]
type = weapon
slot = 2
firerate = 0.05
catagory = projectile
projectile = mac_shell
attribute = enemy_health <==== This is the damage attribute! change yours to health!!!!!!!!!!1
ammunition = smg_shell
ammopershot = 1
loosemag = true
shotpermagazine = 32
attacksound = Weapon\modern\mac.wav
emptysound = Weapon\dryfire_rifle.wav
reloadsound = Weapon\rifle_reload.wav
muzzleflash3rd = MuzzleFlash
;
; 1st Person
;
viewactor = Weapon\ingram\mac.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = 305 90 8.4
viewoffset = -1.8 -5.4 -21.8
viewscale = 0.31
viewlaunchoffset = 0 0 25
viewlaunchbone = fire
viewanimationspeed = 1
viewarmanim = arm
viewidleanim = idle
viewattackanim = fire
viewaltattackanim = fire
viewhitanim = idle
viewalthitanim = idle
viewwalkanim = walk
muzzleflash = MuzzleFlash1
crosshair = crosshairs\pistol.bmp
crosshairalpha = crosshairs\a_pistol.bmp
crosshairfixed = true
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
zoomamount = 1.1
zoomoverlay = mac.bmp
zoomoverlayalpha = a_mac.bmp
allowzoommove = false
recoilamount = 20
recoildecay = 20
bobamount = 10
viewreloadanim = reload
viewkeyreloadanim = reload
viewattackemptyanim = idle
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0
;
; 3rd person
;
playeractor = weapon\Ingram\ingram.act
playerfillcolor = 255 255 255
playerambientcolor = 255 255 255
playerrotation = -90 180 0
playerscale = 1
playerlaunchoffset = 0 0 25
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

still wont work. I changed enemy health to plain health and it would'nt work either.
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

hmm............. post your weapon.ini entry and the script
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

Script

{

Spawn[()

{

Console(true);

AttributeOrder("health",20,"Die");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HostileDifferent(false);
SetGroup("Enemy");

}]


Die[()

{

Remove(true);

}]

}




Wepon ini


; C8
;*********************************************************
[c8]
type = weapon
slot = 0
firerate = 0.25
catagory = projectile
projectile = pistol_shell
attribute = health
ammunition = pistol_shell
ammopershot = 1
shotpermagazine = 13
worksunderwater = true
attacksound = weapon\deagle.wav
reloadsound = weapon\generic_reload.wav
emptysound = weapon\click.wav
muzzleflash3rd = MuzzleFlash
;
; 1st person
;
viewactor = Weapon\v_c8.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
;
; 3rd person
;
playeractor = weapon\p_c8.act
playerfillcolor = 128 128 128
playerambientcolor = 128 128 128
playerrotation = -90 180 0
playerscale = 1
playerlaunchoffset = 0 0 25
playerbone = BIP01 R HAND
Those who have all the answers, are never up to date on the questions.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

try
altattribute = health
in the script
i gtg (for like the first time in my life im leavin the housr <_<)
Herp derp.
Ryan
Posts: 161
Joined: Tue May 01, 2007 5:31 am
Location: Tucson Arizona

Post by Ryan »

lol, same here acutally. going out to eat.

Cheers
Those who have all the answers, are never up to date on the questions.
Post Reply