Overgrowth Scripting Mods

A secret forum for people who preorder Overgrowth!
User avatar
key2van
Posts: 130
Joined: Wed Mar 24, 2010 8:35 pm
Location: Canada

Re: Overgrowth Scripting Mods

Post by key2van » Sun Nov 21, 2010 7:40 pm

maybe they are :shock:

pantokraator
Posts: 5
Joined: Tue Jun 22, 2010 12:26 pm

Re: Overgrowth Scripting Mods

Post by pantokraator » Wed Nov 24, 2010 9:55 am

Okay, so I tried to make a knife throwing script. It's basically working, just needs collision detection with ground/props and proper aiming.. obviously it is very basic and robust. Feel free to advance on it.

I present you the codes.

Code: Select all

Declarations:
//panto begin.
bool hasKnife = true;
vec3 defaultKnifePos;
vec3 knifePos;
int knifeLifeTime;
//panto end.

Workhorse stuff (goes in the main update() function):
	//panto begin.
	if( controlled && GetInputDown( "g" ) ){
	    vec3 initialPos = camera.GetFacing();
		initialPos.y += 0.5f;
		vec3 dynamicPos = this_mo.position;
		dynamicPos.y += 0.3f;
		
		bool breakLoop = false;
		for( int i = 0; i < 200; i++ ){
		    dynamicPos.x += initialPos.x;
			dynamicPos.y += initialPos.y;
			dynamicPos.z += initialPos.z;
			
	    	vec3 targetPos = target.position;
	    	for( int i = 0; i < 3; i++ ){
	    	    targetPos.y += 0.25f;
	        	if( distance(targetPos, dynamicPos) < 0.35f ){
	        	    Print( "BulletCollision.\n" );
	         		
	        		MakeParticle("Data/Particles/impactfast.xml", dynamicPos, vec3(0.0f));
					breakLoop = true;
	        		break;
	        	}
	    	}
			
			if( breakLoop ){
			    break;
			}
		}
	}
	
	if( controlled && GetInputPressed( "f" ) ){
	    if( hasKnife ){
	        hasKnife = false;
			
			defaultKnifePos = camera.GetFacing();
			defaultKnifePos.y += 0.5f;
			knifePos = this_mo.position;
			knifePos.y += 0.3f;
		}
	}
	
	if( !hasKnife ){
    	MakeParticle("Data/Particles/impactfast.xml", knifePos, vec3(0.0f));
		
		vec3 targetPos = target.position;
		for( int i = 0; i < 3; i++ ){
		    targetPos.y += 0.25f;
	    	if( distance(targetPos, knifePos) < 0.35f ){
	    	    Print( "KnifeCollision.\n" );
	    		
	    		hasKnife = true;
	    		knifeLifeTime = 0;
	    	}
		}
		
		knifePos.x += defaultKnifePos.x;
		knifePos.y += defaultKnifePos.y;
		knifePos.z += defaultKnifePos.z;
		defaultKnifePos.y -= 0.0025f;
		
		knifeLifeTime += 1;
		if( knifeLifeTime > 125 ){
		    hasKnife = true;
			knifeLifeTime = 0;
		}
	}
	//panto end.
Alternatively, here is the pastebin version: http://pastebin.com/dwKWfGXR .

Scorpion1122
Posts: 28
Joined: Thu Dec 02, 2010 4:19 am

Re: Overgrowth Scripting Mods

Post by Scorpion1122 » Fri Dec 03, 2010 5:36 am

Hey everybody, im new to the SPF and im trying to do some verry simpel scripting. But have a small question. Can you retrieve and change data from the person that attacked you?

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Overgrowth Scripting Mods

Post by Endoperez » Fri Dec 03, 2010 6:41 am

Scorpion1122 wrote:Hey everybody, im new to the SPF and im trying to do some verry simpel scripting. But have a small question. Can you retrieve and change data from the person that attacked you?
You probably can. I'm not sure if there's an easy way, but I think you can do it.

Try to find the code for choosing the next target. The last time I checked it, it was a for-loop that goes through all the characters, checking your distance to each. By copying that loop, you can go through all the animated chars in the scene.

Then, check the function WasHit(vec3 dir, vec3 pos). At least a few weeks ago, 'dir' was the vector from the attacker to the defender (pos is just the position of the hit, so probably not useful for this purpose). Then check your current position and dir against all the chars in the scene.


Most of this is from memory, and I haven't checked the code in a few weeks. It might be a lot easier than this.

User avatar
Vrav
Posts: 83
Joined: Tue Oct 21, 2008 1:35 am
Location: Seattle, WA
Contact:

Re: Overgrowth Scripting Mods

Post by Vrav » Tue Dec 07, 2010 11:17 pm

I'm curious how mods are going to be handled in the game. Will it be a directory-based thing, like id games? They have their base directory, and subsequent gamedirs can be loaded either via console or a batch file / shortcut, and the order in which they are loaded is important - for example, maybe you load in the base game, then your small mod that tweaks the gameplay.

This system seems nice and organized, and probably wouldn't be very hard to integrate some UI mod management for it. I remember seeing something about Overgrowth mod management in the past, but that was mostly about having a system to rate/download them, if I recall.

zalo
Posts: 56
Joined: Tue Jul 06, 2010 11:22 pm

Re: Overgrowth Scripting Mods

Post by zalo » Wed Dec 08, 2010 12:09 am

I believe a system like GMod's addon folder would be most beneficial, as it would keep the original stuff "vanilla" and the mods in an easily searchable, and manageable place.

Also, that knife thing sounds cool, does is it instant like a bullet, or does it take time for the knife to go through the air? Even if it is instant, maybe a tracer particle would add to the over-all effect?

User avatar
admalledd
Posts: 16
Joined: Mon Dec 06, 2010 10:05 pm

Re: Overgrowth Scripting Mods

Post by admalledd » Wed Dec 08, 2010 3:14 am

and here i bought the game shortly after trying lugaru on a friends computer, now i hear about mod scripting? anyone else feel like they underpayed when they bought the game? :D

Scorpion1122
Posts: 28
Joined: Thu Dec 02, 2010 4:19 am

Re: Overgrowth Scripting Mods

Post by Scorpion1122 » Wed Dec 08, 2010 7:47 am

Endoperez wrote:
Scorpion1122 wrote:Hey everybody, im new to the SPF and im trying to do some verry simpel scripting. But have a small question. Can you retrieve and change data from the person that attacked you?
You probably can. I'm not sure if there's an easy way, but I think you can do it.

Try to find the code for choosing the next target. The last time I checked it, it was a for-loop that goes through all the characters, checking your distance to each. By copying that loop, you can go through all the animated chars in the scene.

Then, check the function WasHit(vec3 dir, vec3 pos). At least a few weeks ago, 'dir' was the vector from the attacker to the defender (pos is just the position of the hit, so probably not useful for this purpose). Then check your current position and dir against all the chars in the scene.


Most of this is from memory, and I haven't checked the code in a few weeks. It might be a lot easier than this.
Didnt realy get it working because i cant get a specific target (and cant change a var from that target), probably because im verry new to game scripting/angel script :P.
But its always fun to keep trying and experimenting.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Overgrowth Scripting Mods

Post by Endoperez » Wed Dec 08, 2010 7:57 am

Scorpion1122 wrote: Didnt realy get it working because i cant get a specific target (and cant change a var from that target), probably because im verry new to game scripting/angel script :P.
But its always fun to keep trying and experimenting.
Yes, the options are still quite limited. :lol: Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?

Scorpion1122
Posts: 28
Joined: Thu Dec 02, 2010 4:19 am

Re: Overgrowth Scripting Mods

Post by Scorpion1122 » Wed Dec 08, 2010 12:06 pm

Endoperez wrote:
Scorpion1122 wrote: Didnt realy get it working because i cant get a specific target (and cant change a var from that target), probably because im verry new to game scripting/angel script :P.
But its always fun to keep trying and experimenting.
Yes, the options are still quite limited. :lol: Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?
i was trying to create a sort of combo system. Where with each hit you become stronger and apply more force to your target. I thought i had it working but realised is stored a combo counter for each of my targets.
For Example: i would hit gaurd 1, but instead of my combo counter going up his went up. so when i would go on and hit gaurd 2 i would hit normally again.

But i made 2 mistakes.. Where i changed the force applied to the target. So i did eventually hit verry hard (which led to pretty funny ragdolls). But it was different with each target AND it would work for everyone that hit said target.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Overgrowth Scripting Mods

Post by Endoperez » Wed Dec 08, 2010 12:24 pm

Scorpion1122 wrote:
Endoperez wrote:
Scorpion1122 wrote: Didnt realy get it working because i cant get a specific target (and cant change a var from that target), probably because im verry new to game scripting/angel script :P.
But its always fun to keep trying and experimenting.
Yes, the options are still quite limited. :lol: Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?
i was trying to create a sort of combo system. Where with each hit you become stronger and apply more force to your target. I thought i had it working but realised is stored a combo counter for each of my targets.
For Example: i would hit gaurd 1, but instead of my combo counter going up his went up. so when i would go on and hit gaurd 2 i would hit normally again.

But i made 2 mistakes.. Where i changed the force applied to the target. So i did eventually hit verry hard (which led to pretty funny ragdolls). But it was different with each target AND it would work for everyone that hit said target.

Ooh, nice one!

I'm not sure how you managed to do it that way. I could give it a look and see if I can find a way to get it working, if you'd like.

Scorpion1122
Posts: 28
Joined: Thu Dec 02, 2010 4:19 am

Re: Overgrowth Scripting Mods

Post by Scorpion1122 » Wed Dec 08, 2010 4:59 pm

Endoperez wrote: Ooh, nice one!

I'm not sure how you managed to do it that way. I could give it a look and see if I can find a way to get it working, if you'd like.
Go ahead, would be interesting to see if you succeed :)

User avatar
Silverfish
Posts: 1451
Joined: Sun Oct 26, 2008 8:24 pm
Location: Sweden
Contact:

Re: Overgrowth Scripting Mods

Post by Silverfish » Fri Dec 10, 2010 11:32 am

Scorpion1122 wrote:But i made 2 mistakes.. Where i changed the force applied to the target. So i did eventually hit verry hard (which led to pretty funny ragdolls). But it was different with each target AND it would work for everyone that hit said target.
Super Smash Brothers style. :)

zalo
Posts: 56
Joined: Tue Jul 06, 2010 11:22 pm

Re: Overgrowth Scripting Mods

Post by zalo » Wed Jan 26, 2011 9:35 pm

Sorry for ressurecting an old thread, but in the Latest build, I discovered that you could accomplish some pretty good 1st Person View by changing the Camera's old position parameter in the aschar.as to:

Code: Select all

	cam_pos = this_mo.GetIKTargetTransform("head").GetTranslationPart();
(About line 1627)

And the follow distance to:

Code: Select all

	const float _cam_follow_distance = -0.05f;
(About Line 1585)

If I could get a modified Turner model without the head and mouth (just skin where the head was), then it would look pretty professional since the hands are already being held up and animated properly. Maybe I'll download blender and try it out.
Last edited by zalo on Wed Jan 26, 2011 11:46 pm, edited 1 time in total.

zalo
Posts: 56
Joined: Tue Jul 06, 2010 11:22 pm

Re: Overgrowth Scripting Mods

Post by zalo » Wed Jan 26, 2011 10:07 pm

Tried using blender to remove the head of turner, but Overgrowth instantly crashed as soon as I tried to open it up. Maybe someone else could do it?

Post Reply