My first script, and a problem
My first script, and a problem
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??
{
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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.
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?
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.
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
uppercaseRyan 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.
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?
AttributeOrder("health",100,"die");
to
AttributeOrder("health",100,"Die");
Herp derp.
I have yet another problem
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.
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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
{
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.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA