Turok: Dinosaur Hunter Forums!

Turok Games => Turok 2 Seeds of Evil => Turok 2 Seeds of Evil Modding/Mapping => Topic started by: Victorious_Games on July 05, 2018, 10:52:51 AM

Title: Modding Questions for my upcoming project
Post by: Victorious_Games on July 05, 2018, 10:52:51 AM
These are some questions I have about modding Turok 2. I wanted to ask about them first before I go trying to implement them. I didn't want to waste my time on impossible ideas.

Is there a way to to resize blood splat decals?
Is there a way to increase the firing rate for weapons?
Is there a way to make particle effects that are created by weapons loop forever?
Is there a way to have more then 1 firing animation for weapons such as if I press the primary fire button you get one animation but if I press the alternate fire button ( the scope enable/disable button ) you get another firing animation?
Is there a way to change a monsters skin texture when it dies like if it's killed by the flamethrower it turns black?
Is there a way to make the fire that gets on a monster when it's burned by the flamethrower to cover it's whole body and not just it's upper torso?
Is it possible to have a monster spawn another monster through scripts?
Title: Re: Modding Questions for my upcoming project
Post by: Drahsid on July 05, 2018, 01:39:49 PM
Is there a way to resize blood splat decals?
Yes, edit the particle.
Is there a way to increase the firing rate for weapons?
Yes, edit the animation, or alternatively, cut the animation off earlier in the weapons script.
Is there a way to make particle effects that are created by weapons loop forever?
You cannot make particles loop forever unless of course you just spawned another upon death.
Is there a way to have more then 1 firing animation for weapons such as if I press the primary fire button you get one animation but if I press the alternate fire button ( the scope enable/disable button ) you get another firing animation? Haven't we answered this?
From my understanding, I think this is what you want. I had a mag 60 with explosive secondary and bullet primary fire on left and right mouse click lol its a killer weapon but its been awhile though since I was focused on it xD.

This would be a script function you need to do a script, search for this through the scripts to understand.

if((self.Owner().Buttons() & BC_ALTFIRE) != 0)

Its actually applied to the ridingGun.txt in scripts folder that will help to understand some I believe look for ALTFIRE in that document.
Is there a way to change a monsters skin texture when it dies like if it's killed by the flamethrower it turns black?
I haven't looked into the monster code, but you could potentially to a similar thing to what they do with limbs.
Is there a way to make the fire that gets on a monster when it's burned by the flamethrower to cover it's whole body and not just it's upper torso?
Unless it's a part of the monster's animations, edit the particle.
Is it possible to have a monster spawn another monster through scripts?
ActorFactory.Spawn(), lookit the API.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 05, 2018, 02:12:42 PM
Hey thanks a lot man for the reply. But when I was asking about having more then one firing animation for a weapon I was talking about an actual animation and not just a secondary fire mode like my other thread was asking about. I understand exactly how to add that secondary fire mode but I was wondering if it was possible to have a second firing animation for that secondary fire mode or does the weapon have to use the same firing animation for both fire modes?

What is the particle for the blood splat decals? I haven't been able to find which one to edit.

Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 05, 2018, 10:09:50 PM
Ok I understand how to make a new animation for the secondary fire modes.

My next question: Is there a way to tell in the scripts what type of ammo you are using?

Also how exactly do you cut the firing animation off in the weapon scripts to increase the firing rate?
Title: Re: Modding Questions for my upcoming project
Post by: Duke64 on July 06, 2018, 01:21:26 AM
Ok I understand how to make a new animation for the secondary fire modes.

My next question: Is there a way to tell in the scripts what type of ammo you are using?

Also how exactly do you cut the firing animation off in the weapon scripts to increase the firing rate?

The type of ammo is defined in

defs>weaponinfo.txt

Weapon kWpn_Magnum
{
    offset                  "6 7 10"
    actor                   kActor_Wpn_Mag60
    defaultWeapon           FALSE
    owned                   FALSE
    allowUnderwater         FALSE
    allowLand               TRUE
    allowMultiplayer        TRUE
    icon                    "gfx/hud/weapons/h_w_mag60.png"
    ammo                    "Ammo_Bullet"
    ammoConsumption         1
    projectileParticle      kParticle_MagnumBullet
    charMeshIndex           kWpnChar_Mag60
   priority                8000
}

I wouldn't cut off firing animations there is a way you can make the firing animations speed up or any generally. Used it in my mods 'Fossil Cavern' and 'Turok lives again' scripted to fire fast.

    /*
    ==============================================================
    OnFire
    ==============================================================
    */
   
    void OnFire(void)
    {
        self.PlaySound("sounds/shaders/TOMMY.ksnd");
   self.AnimTrackComponent().ChangeSpeed(0.64f);

    }
   
    /*
Title: Re: Modding Questions for my upcoming project
Post by: Rok on July 06, 2018, 01:28:24 AM
Did you change it to 0.64 on purpose lol. Oh you should maybe link those mods, here.

Turok Lives Again: https://turoksanctum.com/turok-lives-again/

Fossil Cavern: https://turoksanctum.com/fossil-cavern-v1/
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 06, 2018, 09:17:19 AM
What I meant by "Is there a way to tell in the scripts what type of ammo you are using?" was how can I tell in the weapon scripts if I'm using normal shotgun shells or explosive shotgun shells.
Title: Re: Modding Questions for my upcoming project
Post by: Jay Doomed on July 06, 2018, 09:59:20 AM
Sixty already said it I think. defs/weaponinfo. That's not in scripts its in the defs.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 06, 2018, 10:31:08 AM
Sixty already said it I think. defs/weaponinfo. That's not in scripts its in the defs.

I understand what he said but in the weapon scripts I need to be able to tell if the player is currently using normal shotgun shells or explosive shotguns shells. Is there a way to check which ammo type the player is using in the weapons scripts? I currently have the primary fire button shooting 1 shotgun shell and the secondary fire button shooting 2 shotgun shells. But the only way to get the secondary fire button to shoot 2 shotgun shells was to add a fireprojectile command that forces it to shoot the shotgun_bullet.particle. It works great for the normal shotgun shells but when using the explosive shotgun shells the shotgun fires 1 explosive shell and 1 normal shell. I need an if statement that will check if the player is using normal or explosive shotgun shells so that I can force it to shoot the proper projectile.

Also is there any way to make the alternate fire button loop the shooting animations for a weapon. For example the shotgun will not continuously shoot when holding down the alternate fire button like it does when holding down the primary fire button. Is there a way to fix this or is this something in the source? 
Title: Re: Modding Questions for my upcoming project
Post by: BehemothProgrammer on July 06, 2018, 07:01:55 PM
someone :alien: me to help you so here I am.

No there's no way to tell what ammo type a weapon is currently set to. And no again  there's no way to detect if the alt fire button is being held down, but for every other button you can. (isn't that great?)
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 06, 2018, 10:49:24 PM
Well crap. Oh well I can live with those shortcomings. Not game breaking at all. Thanks for the help. I’ll be announcing my mod soon. Got lots of ideas and features already implemented.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 07, 2018, 01:56:17 PM
Is it possible to increase the tranq time for monsters when shot by the tranq gun?
Title: Re: Modding Questions for my upcoming project
Post by: BehemothProgrammer on July 07, 2018, 03:13:52 PM
Short answer: No you can't change that.
Long answer: create an Enemy script for all Enemy Defs and OnTick check if their mode state == 30 (Reaction FallDown (Tranqulized anim start)) and try setting the mode time to 0 until you want them to wake up. If that doesn't work try checking if their mode state is not 30 then set it back to 30 until you want them to wake up. A list of all the modes states and other info can be found in my script api help file.
Very long answer: you have to make the tranq gun not fire that particle Type, and fire your own custom one. Then in script check if the ai was hit by your particle type and make them go into their sleep animation and then pause the animation until there done sleeping. You'll also need to disable the kEnemyAIComponent while sleeping.

Download this for a list of all the script classes and functions. It'll help show you what you can change from script.
Turok 2 Scripting API: https://www.dropbox.com/s/oyff8tb6z9klsgm/Turok2API.zip?dl=0

Download Fireseed to edit animation/skinned mesh data, or import/export static meshes.
Fireseed: https://www.turokforums.com/index.php?topic=388.0

While this is intended for Turok 1, Turok 2 is almost exactly the same for particles. So checking out smoke39's guide would help for particles. And also just open some existing particles in the games particle folder for examples.
smoke39 Turok 1 Fx Guide: https://smoke39.github.io/turok/fx.html
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 07, 2018, 08:45:08 PM
He thanks a lot man. This will help me a lot.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 08, 2018, 09:58:16 AM
Ok so I’m having trouble figuring out where exactly this script needs to be called on. I thought for sure the enemy defs would call a certain script like the weapons but they do not. So how do I get them to call on a custom script. And where is the default script for the enemies? I need to know what void statements are permitted.

Also is it possible to make a friendly turret?
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 08, 2018, 05:30:45 PM
Ok I've been trying to get something like this to work:

Code: [Select]
self.Spawn(kActor_AI_Raptoid, self.Origin(), 0.0f, 0.0f, 0.0f, true, nRegionIdx);
But it never works. What am I doing wrong here?

Just noticed something else. After adding blood effects to explosion effects caused by explosive weapons when making contact directly with monsters they now make blood effects when hitting such objects as barrels. Is there any way to keep explosive projectiles when hitting explosive barrels from causing the same explosion effects as if they were hitting a monster? They should be making the explosion effect you'd see if they were to hit a wall or floor. Why are the explosive barrels using the same material type as monsters?
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 10, 2018, 09:20:20 AM
Is there an event number for fire damage? I can't find one for shock either.

Also has anybody else noticed what I was asking about before? The exploding barrels using the same material as humans or creatures when hitting them with explosive projectiles?
Title: Re: Modding Questions for my upcoming project
Post by: BehemothProgrammer on July 10, 2018, 10:06:08 PM
Quote from: Victorious_Games
Ok so I’m having trouble figuring out where exactly this script needs to be called on. I thought for sure the enemy defs would call a certain script like the weapons but they do not. So how do I get them to call on a custom script. And where is the default script for the enemies? I need to know what void statements are permitted.
You need to set that up in the enemies defs like other defs that use a script component. Look at the defs in the game and copy and paste the text needed in the defs to add your script.

Quote from: Victorious_Games
Also is it possible to make a friendly turret?
You'd have to write a script to do that.

Ok I've been trying to get something like this to work:
Code: [Select]
self.Spawn(kActor_AI_Raptoid, self.Origin(), 0.0f, 0.0f, 0.0f, true, nRegionIdx);But it never works. What am I doing wrong here?
you spawn from ActorFactory not from the actor.
Code: [Select]
ActorFactory.Spawn(kActor_AI_Raptoid, self.Origin(), 0.0f, 0.0f, 0.0f, true, nRegionIdx);
Is there an event number for fire damage? I can't find one for shock either.
No such thing.

Also has anybody else noticed what I was asking about before? The exploding barrels using the same material as humans or creatures when hitting them with explosive projectiles?
I don't know what you did exactly but there could be a few reasons. If you're causing "violent" type of damage that always forces a flesh impact. And most projectiles that impact flesh and creature surface types spawn blood particles. So make sure your barrels surfaces aren't those types.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 11, 2018, 12:01:08 AM
Ok so I started using you work found here https://www.turokforums.com/index.php?topic=496.0 (https://www.turokforums.com/index.php?topic=496.0) as a base for my project. I converted all my changes to your optimized layout and it's so much nicer now to work with. I understand now what you were saying about adding scripts to enemies. You have seriously made a very nice workspace for Turok 2 modding and I strongly recommend everybody to use your work as a starting point. Awesome job on your part. It has a much better streamlined approach and a nice set of cool features that can be easily tinkered with for both monsters, weapons, and the player. Again great job.

Ok so about my issue with the destructible objects acting like they're made of human or creature flesh, you said I should check if they are using improper materials. Would this be done using the map editor or scripts? Because I've never made changes to the barrels or other destructible objects with a map editor. I simply used this mod https://steamcommunity.com/app/405830/discussions/1/135513549100098472/ (https://steamcommunity.com/app/405830/discussions/1/135513549100098472/) as a base to enhance the blood and gore in the game. Could there be an issue with his work?
Title: Re: Modding Questions for my upcoming project
Post by: BehemothProgrammer on July 12, 2018, 04:31:58 AM
Looks like it's the mod because I see some particles that are spawning blood particles on impact with: "default", "stone", "metal". You can look at each of those particle files and try changing them back to the way they were for those surface types by referencing the games particle files of the same name.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 12, 2018, 09:14:37 AM
Looks like it's the mod because I see some particles that are spawning blood particles on impact with: "default", "stone", "metal". You can look at each of those particle files and try changing them back to the way they were for those surface types by referencing the games particle files of the same name.

Oh ok It's probably something I overlooked. More then likely the blood.particle or bloodblob.particle files since they're used by multiple bloody explosion particle effects. Thanks for the heads up.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 12, 2018, 03:37:07 PM
Well so far I've got secondary fire modes for all weapons, lots more blood and gore, and I figured out how to get certain monsters to spawn a specific number of specific monsters as soon as they're spawned into a map. So there are now more monsters in every map to kill without having to edit the actual map. And soon I'll have damage skins for all monsters too when they die. So if they're killed by the flamethrower they'll look burnt up. Or if they're killed by the shotgun they'll have bullet wounds on their bodies. Of course not decals just bloodied versions of their skins. Will post a full list of implemented features and features I want to add as well as the name of my mod.

I'm still in need of ideas for the flamethrower's alternate fire mode.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 12, 2018, 08:52:13 PM
Ok so the only way to keep the barrels from spraying blood everywhere when hitting them with lets say a scorpion missile, that does explosive damage to human and creature material types, is to make the particle effect spawned when hitting monsters or humans not produce any kind of blood effects. For some reason the exploding barrels or even the destructible walls in the river of souls 1 map are using the explosion particle effects that are supposed to be used by the flesh materials. The material files for the barrel textures are set to have a default material type. What is up with this? Bullets do not do this at all. This only happens if a projectile is set to do explosive type = 17 damage to monsters. If you set the damage type to 2 the barrels use the default material type. Anybody got a clue?
Title: Re: Modding Questions for my upcoming project
Post by: Drahsid on July 16, 2018, 12:48:55 AM
Since every world component share the same base class, I'm pretty sure this bug is unfixable, unless you completely reprogram the blood particles.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 16, 2018, 09:05:40 AM
Yeah I figured this was the case. Doesn't make sense why it would be programmed this way though? I'll just make all surface types when hit by explosive damage projectiles cause the same explosion effects without blood to appear. That's how it was in the game to begin with. I'll add blood effects to each of the monsters explosion damage animations to compensate. Thanks for the help.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 18, 2018, 12:25:31 PM
Quick update: Riding Gun now has a total of 6 attack modes. Dual artillery cannons, 20mm autocannon, horned charge, plasma beam cannon, mobile mortar cannon, and a scatter cannon which is like an oversized tank shotgun. All 3 of the new weapons have there own cool down time with hud prompts letting u know when they need to be reloaded or cooled down. So u can’t just constantly use them.


So much fun. I wish the ride was longer or that u got to ride the styracosaurus more then once.
Title: Re: Modding Questions for my upcoming project
Post by: Victorious_Games on July 19, 2018, 12:48:05 PM
What’s the deal with the Nuke damage type? I was messing around with it trying it out on different weapons and sometimes it works but then sometimes it causes Explosive damage type instead of the Nuke damage type. Add it to lets say charge darts and it works but add it to a new sunfirepod projectile that is more of an explosive type projectile and it only causes Explosive damage instead of the Nuke damage that freezes your enemies and turns them black. Event type 33 is for Nuke damage right?