Pleese Help! *SOLVED* thanks! :)

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
psYco
Posts: 782
Joined: Wed Mar 15, 2006 10:55 am
Location: England

Pleese Help! *SOLVED* thanks! :)

Post by psYco »

Im sorry but im not even sure if this is the rite place for this topic because im not even realy sure why its not working, I have made a few games before but have never had this problem, I have created a level and a new pawn whitch i have scripted with a working script and a pawn order and I have made the actor but for some reason reality factory crashes for no apparent reason when i try to run the level with the pawn in! this RF's error report and the pawn ini and the pawn's script,

RF error report
Searching for fullscreen driver

Initializing Game Shell...
--------------------------------------
--- Reality Factory 080 test build ---
--- For more Information, visit: ---
--- http://www.realityfactory.ca ---
--------------------------------------



Parsed RealityFactory.ini file


Genesis 3d Initialized

Initializing Camera Manager...
Initializing User Input Subsystem...
Initializing Audio Manager Subsystem...
Initializing CD Audio Manager Subsystem...
Initializing Midi Audio Manager Subsystem...
Initializing RF Menu Manager Subsystem...
Initializing Network...
Loading Menu.ini...
Parsing Menu.ini...
Initializing Menu
File open attempt failed on type '9', file '.\savedgames.rgf'

Initializing Collision Manager Subsystem...
Initializing Network Manager Subsystem...
Initializing AVIFile Video Subsystem...
Launching Reality Factory Game Shell...
Entering CRFMenu::DoMenu()
Creating Camera
Entering ProcessMenu...
CRFMenu::ProcessMenu Entered
Entering Windows Message Loop, Rendering Game Menu
Initializing Level: levelone.bsp

Configuring Camera Defaults...
Initializing Entity Registry...
Initializing Terrain Manager...
Initializing Effects Manager...
Initializing Actor Manager...
Parsing Environment Setup Entity...
Initializing Model Manager...
Creating Player Avatar...
Loading Player Avatar...
Initializing HUD...
Initializing Damage Subsystem...
Initializing FixedCamera Manager Subsystem...
Loading Player Configuration...
Loading Attributes and Player Configuration from PlayerSetup.ini
Loading Environmental Audio
Parsing PlayerSetup Entity
Set LevelViewpoint
Set Initial Player Actor Scale, Rotation, Shadow and Lighting
Set Player Bounding Box
Parsing EnvironmentSetup Entity
Initializing Automatic Door Manager Subsystem...
Initializing Moving Platform Manager Subsystem...
Initializing Teleport Manager Subsystem...
Initializing MorphingField Effects Manager Subsystem...
Initializing 3d AudioSource Manager Subsystem...
Initializing Particle Effects Manager Subsystem...
Initializing Static Entity Props Subsystem...
Initializing Static Mesh Subsystem...
Initializing Soundtrack Toggle Subsystem...
Initializing Streaming Audio Manager Subsystem...
Initializing Video Texture Manager Subsystem...
Initializing Corona Manager Subsystem...
Initializing Dynamic Light Manager Subsystem...
Initializing ElectricBolt Manager Subsystem...
Initializing Procedural Texture Manager Subsystem...
Initializing Path Database...
Initializing Path Followers...
Initializing Rain Effects Manager...
Initializing Spout Effects Manager...
Initializing ActorSpout Effects Manager...
Initializing Floating Particle Effects Manager...
Initializing eChaos Effects Manager...
Initializing Flame Effects Manager...
Initializing ScriptPoint Manager Subsystem...
Initializing Pawn Manager Subsystem...
Setting Projected Shadows for Pawn1
Projected Shadows : true
Initializing ChangeAttribute Manager Subsystem...
Initializing Countdown Manager Subsystem...
Initializing Trigger Manager Subsystem...
Initializing LogicHandler Subsystem...
Initializing Message Manager Subsystem...
Initializing Effect Manager Subsystem...
Initializing Weapon Manager Subsystem...
Initializing FirePoint Manager Subsystem...
Initializing Flipbook Manager Subsystem...
Initializing AreaCheck Manager Subsystem...
Initializing Foliage Manager Subsystem...
Initializing Tree Manager Subsystem...
Initializing PWXImage Manager Subsystem...
Initializing Shadow Manager Subsystem...
Initializing Decal Manager Subsystem...
Initializing WallDecal Manager Subsystem...
Initializing LevelController Manager Subsystem...
Initializing Attribute Manager Subsystem...
Initializing Explosion Manager Subsystem...
Initializing Explosion Subsystem...
Initializing ChangeLevel Manager Subsystem...
Initializing ScreenShake Subsystem...
Initializing ViewSwitch Subsystem...
Initializing Inventory Subsystem...
Initializing Liquid Subsystem...
Initializing Overlay Subsystem...
Initializing TextureMorph Subsystem...
Initializing CutScene Subsystem...
Initializing ActorMaterial Subsystem...
Initializing Armour Subsystem...
Initializing LiftBelt Manager...
Initializing CDSpotlight Manager...
Initializing CurvedSurfaces Manager...
Preparing to Launch Game...
CRFMenu::GameLoop() - Setup and Run Level
CRFMenu::GameLevel() - Entering Inner Game Loop
CGenesisEngine::BeginFrame failed
Pawn ini

Code: Select all

[zombie]
actorname = zombie.act
actorrotation = 0 180 0
actorscale = 1.5
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
environmentmapping = false
allmaterial = true
percentmapping = 60
percentmaterial = 100
projectedshadows = true
Pawn scipt

Code: Select all

{

	 //   Male Zombie

	SCALE			[1]		// scale of actor
	GROUP			[zombie]	// name of monster group
	BOXWIDTH		[0]		// width and depth of bounding box
        HOSTILEPLAYER		[true]		// hostile to player
	HOSTILEDIFFERENT	[false]		// hostile to different Pawn group
	HOSTILESAME		[false]		// hostile to same Pawn group
	HEALTHATTRIBUTE	        [health]	// name of health attribute
	HEALTH			[100]		// initial amount of health
	SIGHTDIST		[2000]		// max distance monster can see at idle
	ALERTSIGHTDIST		[4000]		// max distance monster can see when alert
	FOV			[360]           // field of view in degrees
	YAWSPEED		[100]		// speed of rotation in deg/sec
	DAMAGEATTRIBUTE		[health]	// attribute damaged by attack
	ALERTTRIGGER		[AlertG]	// name of alert trigger

	// define the type of monster this will be

	ATTACKTYPE		[melee]		// type of attack - melee or missile
	PATROL			[false]		// false - ambush or true - patrol

	// idling and turning

	STAND				[idle]		// idle animation
	TURNL				[]		// turn left animation
	TURNR				[]		// turn right animation

	// when in pain

	PAIN				[pain]		// pain animations
	PAIN1				[pain]
        PAIN2				[pain]
        PAIN3				[pain]
	PAINPERCENT			[50]		// percentage of time pain is shown
	PAINSOUND			[mpain25_2.wav]	// sounds played when in pain
	PAINSOUND1			[mpain50_2.wav]
	PAINSOUND2			[mpain75_2.wav]
	PAINSOUND3			[mpain100_2.wav]

	// when dying

	DIE				[die1]	// dying animations
	DIE1				[die2]
	DIE2				[die3]
	DIE3				[die4]
	DIEHOLD			        [3]		// time corpse still appears
	DIEFADE				[3]		// fadeout time of corpse
	DIESOUND			[mdeath1.wav]	// sounds played when dying
	DIESOUND1			[mdeath2.wav]
	DIESOUND2			[mdeath3.wav]
	DIESOUND3			[mdeath4.wav]

	// when running to attack

	RUN				[walk1]		// running animation
	RUNSPEED			[50]		// average run speed
	RUNSOUNDDELAY		        [2]		// delay between making sounds when running to attack
	RUNSOUND			[mwalk1.wav]	// sound played while running to attack

	// when walking while patroling

	WALK				[walk1]		// walking animation
	WALKSPEED			[50]		// average walking speed

	// the melee attack mode

	MELEEATTACK			[attack1]	// melee attacking animations
	MELEEATTACK1			[attack2]
	MELEEATTACK2			[attack3]
        MELEEATTACK4                    [attack4]
	MELEESOUND			[mmelee1.wav]	// sounds played when melee attacking
	MELEESOUND1			[mmelee2.wav]
	MELEESOUND2			[mmelee3.wav]
	MELEERANGE			[90]		// max distance to start melee attack
	MINMELEEDAMAGE		        [5]		// minimum amount of damage per melee attack
	MAXMELEEDAMAGE		        [10]            // maximum amount of damage per melee attack
	MELEEDELAY			[5]		// number of seconds between melee damages
	MELEEDAMAGESOUND		[mmelee2.wav]	// sound played when damage is done

	// search for enemy

	LOSTTIME			[15]		// time to search for enemy before giving up
	POINTRADIUS			[20]		// radius from point when considered there

	// obstacle avoidance forces for jumping

	FORCEUP			        [60]		// obstacle avoidance jump speed
	FORCEFORWARD			[30]		// obstacle avoidance forward speed
	FORCESIDE			[30]		// obstacle avoidance sideways speed

	// local variables - do not change

	
	RUNFUNC			        [monster_run_start]			// monster run to attack function
	MISSILEFUNC			[monster_missile_start]		// monster missile function
	MELEEFUNC			[monster_melee_start]		// monster melee function
	LOSTFUNC			[monster_lost_target_start]	// monster lost target function

	AS_NONE				[0]
	AS_MELEE			[1]
	AS_MISSILE			[2]
	AS_STRAIGHT			[3]
	attack_delay			[0]
	melee_time			[0]
	lost_time			[0]
	back_up				[false]
	back_time			[0]
	left_time			[0]
	back_flag			[false]
	fire_delay			[0]
	skill_time			[0]
	attack_state			[0]
	run_sound_time			[0]
	missile_sound			[NULL]

	// spawn pawn and do setup work

	Spawn[ ()
	{
		Console(false);
		Scale(SCALE);	// scale the actor
		if(BOXWIDTH > 0)
		{
			BoxWidth(BOXWIDTH*SCALE);			// set bounding box width/depth
		}
		AttributeOrder(HEALTHATTRIBUTE, HEALTH, "Death");	// give monster health
		HostilePlayer(HOSTILEPLAYER);	// set who monster is hostile to
		HostileSame(HOSTILESAME);
		HostileDifferent(HOSTILEDIFFERENT);
		SetFOV(FOV);					// set field of view
		SetGroup(GROUP);				// assign a group to belong to
		FindTargetOrder(SIGHTDIST, "FoundTarget", DAMAGEATTRIBUTE);	// seen a target to chase
		AddPainOrder("IdlePain", 100);				// show pain and trigger alert
		AvoidOrder("Avoidance");
		AddTriggerOrder("IdleToAlert", ALERTTRIGGER, 0);	// go to alert when triggered 
                AddTriggerOrder("GoLowCheck", INTERACTTRIGGER, 0);	// go to interactmode when triggered 
		RotateToPoint(STAND, YAWSPEED, false, ""); // go to point if any specified
		MoveToPoint(WALK, WALKSPEED*SCALE, "");
		if(PATROL = false)
		{
			NewOrder("Idle");
		}
		else
		{
			NewOrder("Patrol");
		}
	} ]

	// avoid objects when doing a MoveToPoint

	Avoidance[ ()
	{
		if(random(1,10)<3)	// backup and move sideways sometimes
		{
			MoveBackward(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
			MoveRight(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
		}
		else
		{
			Jump(RUN, FORCEUP*SCALE, true, "");
			if(random(1,10)<6)
			{
				Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, 90, 0, "");
			}
			else
			{
				Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, -90, 0, "");
			}
		}
		Return();
	} ]

	// idle in place waiting for something to happen

	Idle[ ()
	{
                // need to monitor if the player is within distance and if so, detect the usekey being pressed
		PlayAnimation(STAND, true, "");
                PlayerDistOrder(BOXSIZE,"GoLowCheck");

		if(random(1,10)>6)
		{
			if(random(1,10)>5)
			{
				Rotate(TURNL, 102, 0, 90, 0, "");
				PlayAnimation(STAND, true, "");
				Rotate(TURNR, 108, 0, -90, 0, "");
			}
			else
			{
				Rotate(TURNR, 108, 0, -90, 0, "");
				PlayAnimation(STAND, true, "");
				Rotate(TURNL, 102, 0, 90, 0, "");
			}
		}
		RestartOrder();
	} ]	

        GoLowCheck[()
        {
        // Switch to low level
        LowLevel("CheckIn");
        }]
        
        CheckIn[()
        {
        // Check if keynumber 22 is pressed. Key 22 is, O
                if(self.key_pressed=22)
                {
                // OK, key is pressed. get in
                self.think="GetIn";
                return 0;
                }
                if(self.player_range>BOXSIZE)
                {
                // Player no longer near pawn. Go to High Level Idle.
                HighLevel("Idle");
                return 0;
                }
        }]
        
        GetIn[()
        {
        // Set Think Time to run every frame.
        self.ThinkTime=0;
        //SetEventState(DRIVINGTRIG,true);
        self.think="InteractPlayer";
        }]
	// walk the beat from point to point

	Patrol[ ()
	{
		NextPoint();
		RotateMoveToPoint(WALK, YAWSPEED, WALKSPEED*SCALE, false, "");
		MoveToPoint(WALK, WALKSPEED*SCALE, "");
		RestartOrder();
	} ]

	// show pain at idle then trigger to alert

	IdlePain[ ()
	{
		switch(random(1,4)) // chose between 4 animations
		{
			case 1
			{
				PlayAnimation(PAIN, true, PAINSOUND);
			}
			case 2
			{
				PlayAnimation(PAIN1, true, PAINSOUND1);
			}
			case 3
			{
				PlayAnimation(PAIN2, true, PAINSOUND2);
			}
			case 4
			{
				PlayAnimation(PAIN3, true, PAINSOUND3);
			}
		}
		SetEventState(ALERTTRIGGER, true);	// set trigger to go to alert
		Return();
	} ]	

	// start shifting from idle to alert

	IdleToAlert[ ()
	{
		FindTargetOrder(ALERTSIGHTDIST, "FoundTarget", DAMAGEATTRIBUTE);	// increase viewing distance
		AddPainOrder("AlertPain", PAINPERCENT);			// show pain
		AddTimerOrder(1, 10, "AlertToIdle");			// go to idle after 10 secs
		SetEventState(ALERTTRIGGER, false);		// turn off alert trigger
		NewOrder("Alert");
	} ]

	// look around at alert looking for enemy

	Alert[ ()
	{
		if(random(1,10)>5)
		{
			Rotate(TURNL, 102, 0, 90, 0, "");
			Rotate(TURNL, 102, 0, 90, 0, "");
			Rotate(TURNL, 102, 0, 90, 0, "");
			Rotate(TURNL, 102, 0, 90, 0, "");
		}
		else
		{
			Rotate(TURNR, 108, 0, -90, 0, "");
			Rotate(TURNR, 108, 0, -90, 0, "");
			Rotate(TURNR, 108, 0, -90, 0, "");
			Rotate(TURNR, 108, 0, -90, 0, "");
		}
		RestartOrder();
	} ]	

	// show pain at alert

	AlertPain[ ()
	{
		switch(random(1,4)) // play one of 4 animations
		{
			case 1
			{
				PlayAnimation(PAIN, true, PAINSOUND);
			}
			case 2
			{
				PlayAnimation(PAIN1, true, PAINSOUND1);
			}
			case 3
			{
				PlayAnimation(PAIN2, true, PAINSOUND2);
			}
			case 4
			{
				PlayAnimation(PAIN3, true, PAINSOUND3);
			}
		}
		Return();
	} ]	

	// timed out at alert

	AlertToIdle[ ()
	{
		FindTargetOrder(SIGHTDIST, "FoundTarget", DAMAGEATTRIBUTE);	// decrease viewing distance
		AddTriggerOrder("IdleToAlert", ALERTTRIGGER, 0);	// go to alert when triggered
		AddPainOrder("IdlePain", 100);				// show pain 
		if(PATROL = false)
		{
			NewOrder("Idle");
		}
		else
		{
			RotateToPoint(STAND, YAWSPEED, false, "");
			MoveToPoint(WALK, WALKSPEED*SCALE, "");
			NewOrder("Patrol");
		}
	} ]

	// found a target to attack

	FoundTarget[ ()
	{
		DelTimerOrder(1);	// get rid of alert timer
		LowLevel(RUNFUNC);	// attack functions are low level
	} ]

	// lost target while attacking so go back to idle again

	LostTarget[ ()
	{
		FindTargetOrder(SIGHTDIST, "FoundTarget", DAMAGEATTRIBUTE);	// seen a target to chase
		AddPainOrder("IdlePain", 100);				// show pain and trigger alert
		AddTriggerOrder("IdleToAlert", ALERTTRIGGER, 0);	// go to alert when triggered
		if(PATROL = false)
		{
			NewOrder("Idle");
		}
		else
		{
			RotateToPoint(STAND, YAWSPEED, false, "");
			MoveToPoint(WALK, WALKSPEED*SCALE, "");
			NewOrder("Patrol");
		}
	} ]

	// you died

	Death[ ()
	{
		DelTimerOrder(1);	// remove alert timer
		AddPainOrder("IdlePain", 0);	// remove pain order
		FindTargetOrder(0, "FoundTarget", DAMAGEATTRIBUTE);	// remove target finding
		DelTriggerOrder("IdleToAlert");	// remove alert trigger
		SetNoCollision(true);	// remove bounding box so there are no collisions with corpse
		switch(random(1,4)) // chose between 4 death animations
		{
			case 1
			{
				AnimateStop(DIE, DIEHOLD, DIESOUND);
			}
			case 2
			{
				AnimateStop(DIE1, DIEHOLD, DIESOUND1);
			}
			case 3
			{
				AnimateStop(DIE2, DIEHOLD, DIESOUND2);
			}
			case 4
			{
				AnimateStop(DIE, DIEHOLD, DIESOUND3);
			}
		}
		if(DIEHOLD >= 5)
		{
			FadeOut(DIEFADE, 0); // fade out corpse
			Remove(true);	// remove actor
		}
	} ]
        
        Blood[() 
            { 
            SetTargetPoint(random(1,128)-64,-64,random(1,128)-1); 
            FireProjectile("blooddrop","Bip01 Spine",0,0,0,"none",0); 
            SetTargetPoint(random(1,258)-25,-4,random(1,128)-1); 
            FireProjectile("blooddrop","Bip01 Head",0,0,0,"none",0); 
            SetTargetPoint(random(1,128)-64,-64,random(1,100)-50); 
            FireProjectile("blooddrop","Bip01 L Arm1",0,0,0,"none",0);
            SetTargetPoint(random(1,128)-64,-64,random(1,128)-14); 
            FireProjectile("blooddrop","Bip01 Head",0,0,0,"none",0);
            SetTargetPoint(random(1,128)-64,-64,random(1,64)-6); 
            FireProjectile("blooddrop","Bip01 Spine3",0,0,0,"none",0);
            SetTargetPoint(random(1,128)-64,-64,random(1,128)-25); 
            FireProjectile("blooddrop","Bip01 R Leg1",0,0,0,"none",0);                
            self.think = "monster_run_pain";
            }]
:( :cry: Pleeeeeze Help im soooo Confused :shock: :? :(

oh and the Blood commands arnt the problem ive used the exact same code for blood before with no problems.

Thanks! :D [/quote]
Last edited by psYco on Mon Aug 07, 2006 2:58 pm, edited 1 time in total.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

make sure all your textures are powers of two in both dimensions, ie 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024, or 1024x512 etc in any combination.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

I'm not sure if this is a real problem or have you just missed it when copying the script, but you need a "}" symbol in the end of your script.
Pain is only psychological.
User avatar
psYco
Posts: 782
Joined: Wed Mar 15, 2006 10:55 am
Location: England

THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!

Post by psYco »

:D THANKS :D you have no idea how frustrating it was trying everything when nothing works, oh yeah you do.

:D Well thank you very much! This is one of the most helpfull online communitys ive been part of! :lol:
User avatar
allen5924
Posts: 35
Joined: Wed Aug 09, 2006 6:37 am
Location: RSA
Contact:

YAAY

Post by allen5924 »

YAAy u got it to work!!!!
Post Reply