Overgrowth Scripting Mods
Re: Overgrowth Scripting Mods
maybe they are
-
- Posts: 5
- Joined: Tue Jun 22, 2010 12:26 pm
Re: Overgrowth Scripting Mods
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.
Alternatively, here is the pastebin version: http://pastebin.com/dwKWfGXR .
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.
-
- Posts: 28
- Joined: Thu Dec 02, 2010 4:19 am
Re: Overgrowth Scripting Mods
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?
Re: Overgrowth Scripting Mods
You probably can. I'm not sure if there's an easy way, but I think you can do it.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?
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.
Re: Overgrowth Scripting Mods
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.
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.
Re: Overgrowth Scripting Mods
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?
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?
Re: Overgrowth Scripting Mods
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?
-
- Posts: 28
- Joined: Thu Dec 02, 2010 4:19 am
Re: Overgrowth Scripting Mods
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 .Endoperez wrote:You probably can. I'm not sure if there's an easy way, but I think you can do it.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?
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.
But its always fun to keep trying and experimenting.
Re: Overgrowth Scripting Mods
Yes, the options are still quite limited. Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?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 .
But its always fun to keep trying and experimenting.
-
- Posts: 28
- Joined: Thu Dec 02, 2010 4:19 am
Re: Overgrowth Scripting Mods
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.Endoperez wrote:Yes, the options are still quite limited. Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?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 .
But its always fun to keep trying and experimenting.
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.
Re: Overgrowth Scripting Mods
Scorpion1122 wrote: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.Endoperez wrote:Yes, the options are still quite limited. Did you have a specific thing in mind (when you asked for the targeting), or were you just trying out different things?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 .
But its always fun to keep trying and experimenting.
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.
-
- Posts: 28
- Joined: Thu Dec 02, 2010 4:19 am
Re: Overgrowth Scripting Mods
Go ahead, would be interesting to see if you succeedEndoperez 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.
-
- Posts: 1451
- Joined: Sun Oct 26, 2008 8:24 pm
- Location: Sweden
- Contact:
Re: Overgrowth Scripting Mods
Super Smash Brothers style.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.
Re: Overgrowth Scripting Mods
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:
(About line 1627)
And the follow distance to:
(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.
Code: Select all
cam_pos = this_mo.GetIKTargetTransform("head").GetTranslationPart();
And the follow distance to:
Code: Select all
const float _cam_follow_distance = -0.05f;
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.
Re: Overgrowth Scripting Mods
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?