Page 1 of 1

RFCR November 2009

Posted: Sat Nov 21, 2009 5:14 pm
by Jay
On a request from zany, i present you a a communtity release, which adds the possibility to add pawns and also provides some pathfinding, as well as a supposed fix for the "explosion problem".

Feature list:
-changed max number of predefined effects from 200 to 2000
-changed max number of predefined explosions from 50 to 2000

New LowLevel script commands:

-AddPawn(scriptfile, pawnDefinition, entityname, startorder) - TESTED
-Adds a pawn to the world at place 0,0,0 with rotation 0,0,0. You can adjust it via the SetEntityProperties(...) commands.
-MaxNumber of 5120 dynamic pawns at any time - it's so high just to be sure that it is never reached. Maybe i'll set it lower again sometime. Maybe 1000 is a good number.
-The pawn starts with the highlevel order startorder

-AddActor(filename,entityname); - NOT TESTED
-Adds an actor to the game world

-RemoveActor(entityname); - NOT TESTED
-Removes an actor from the game world - ONLY USE WITH ACTORS ADDED WITH AddActor(...) OR IT COULD HAVE UNWANTED SIDE EFFECTS.

-FindPath(scriptpointName); -TESTED
-Tries to find a path to the scriptPoint called scriptpointName. If a path was found then it will return "true", otherwise "false"
-If a path was found, the currentPath will be set to that path, otherwise there will be no current path.
-To access that path, use

-FindPath(endX,endY,endZ); - NOT TESTED
-Tries to find a path to the path point nearest to (endX,endY,endZ).
-Otherwise, behaves like the other FindPath(...) command.

-GetCurrentPathPoint(); - TESTED
-Gets the name of the current point in the path
-If there is no current path it will return "(NO PATH)"
-If the end of the path was reached, it will return "(END OF PATH)"

-AdvancePath(); - TESTED
-Sets the next point in the path as the current point

An example on how to use the AddPawn(...) command:

Code: Select all

	SCRIPTED_PROJ_NUMBER	[0]
	SCRIPTED_PROJ_NAME		[NULL]
	PROJECTILEPATH	[projectiles\\]
	AddProjectile[ ()
	{
		if(TARGET="FALSE")
		{
			return 0;
		}
		SCRIPTED_PROJ_NAME="SP_" # SCRIPTED_PROJ_NUMBER;
		SCRIPTED_PROJ_NUMBER=Integer(SCRIPTED_PROJ_NUMBER)+1;
		AddPawn(PROJECTILEPATH # "scriptedprojectile.s","Controller",SCRIPTED_PROJ_NAME,"Spawn");
		SetEntityPosition(SCRIPTED_PROJ_NAME, GetBoneX(EntityName,"BIP01 R HAND"),
                                          GetBoneY(EntityName,"BIP01 R HAND"), 
                                          GetBoneZ(EntityName,"BIP01 R HAND"));
		SetEntityRotation(SCRIPTED_PROJ_NAME, self.current_pitch, self.current_yaw, 0);
		
               //Set Parameters, accessing the fields of the pawn
		@SCRIPTED_PROJ_NAME.TARGET=StringCopy(TARGET);
		return 1;
	} ]
This is the piece of script i use to add my scripted projectiles.

Also (maybe this will be important to some of you), RF first executes all dynamic pawn scripts before heading on to the static ones. It can however not be said in which order the dynamic pawns are executed.

In the folder you will find the exe and the changed/added source code files in different archives.
http://www.mediafire.com/?sharekey=baff ... 2bd5edc68e

EDIT: somehow it did not work very well, so here are additional links:
EXE: http://www.filedropper.com/addpawnpathfindingexe
SOURCE: http://www.filedropper.com/addpawnpathfindingsource

Have fun.

Re: RFCR November 2009

Posted: Sat Nov 21, 2009 7:06 pm
by zany_001
Thanks Jay! Now I can do a strategy game proof-of-concept, if I ever have more time. It also opens up a lot of stuff to do with scripted projectiles and respawning opponents, etc.

Re: RFCR November 2009

Posted: Sat Nov 21, 2009 8:10 pm
by Jay
Ok something apparently happend and the files just vanished :shock: Will reupload them now..

EDIT: Ok now that's really really strange... it won't let me upload anything and it also won't let me move any items... strange... really strange... i'll see if i can upload it somewhere else.
Until then.

Re: RFCR November 2009

Posted: Sat Nov 21, 2009 9:20 pm
by Jay
Sorry for doubleposting, but that way people will actually see something's changed.

EXE: http://www.filedropper.com/addpawnpathfindingexe
SOURCE: http://www.filedropper.com/addpawnpathfindingsource

Re: RFCR November 2009

Posted: Sat Dec 05, 2009 3:42 am
by darksmaster923
Great work, as usual Jay

Re: RFCR November 2009

Posted: Wed Sep 08, 2010 9:56 pm
by madness
Somehow I managed to miss this post @_@ This sounds wonderful!
Although I have a few questions, I'll try to figure out on my own after I post but I know there were a bunch of things in the works when I last paid attention to the programming sector.

1.
Does this install include the newton physics engine stuff?

2.
Does this install include the multiple pawn weapon attachment thing? Where more then one weapon attachment could be attached to a pawn simultaneously.

3.
Does this install include the pawn multiple damage attribute checking system?

4.
Is this installation up to date with the current main release?

Thanks in advance. I'm really looking forward to having this new flexibility in my game. spawning other pawns opens BIG doors. I've been considering taking my own crack at the source code if any of what I asked isn't included. I was about to make a post about just that when I saw this and noticed it added a bunch of new things that I reeaaallly wanted.

Also, Jay your awesome. <3

Re: RFCR November 2009

Posted: Wed Sep 08, 2010 10:20 pm
by madness
I guess a simpler question would be.. Is "RFCR November 2009" an update of "Reality Factory Community Release April 2008"?

If not, where can I find the "Reality Factory Community Release April 2008 source" (old link is dead) so I can rework it for my own update?