Using items

r_populik
Scavenger
Posts: 47
Joined: 07 Aug 2012, 03:22

Using items

Postby r_populik » 10 Feb 2014, 14:54

I think this is a question to our scripting-magician Alundaio. Which would be the simplest way to add playing animation during using items (assuming that I have done after one hud animation for each item) ?

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 15:33

Smurth created an actor effects script (Used in Misery) with some of my assistance and it can trigger effects when using consumable items.


example:

Code: Select all

   bandage = {
      [0] = "actor_effects.use_weapon(0)",
--      [1] = "level.add_cam_effector('camera_effects\\\\item_use.anm', 8050, false,'')",
      [1040] = "xr_effects.disable_ui_inventory(db.actor, nil)",
      [4150] = "actor_effects.use_weapon(1)"
   },


The number in the brackets is milliseconds and the string is actual code that will be executed during runtime. So it will give you full control to do whatever you want, like hide actor weapon, play the animation along with cam effectors and etcetera.

I may be a magician but my knowledge only extends to areas I have experience with. I have no experience with playing actor HUD animations. Is there even a function for it? If you know of an example from an other mod of playing HUD animations I'll write a function that you can plug into actor_effects_data.script.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

r_populik
Scavenger
Posts: 47
Joined: 07 Aug 2012, 03:22

Re: Using items

Postby r_populik » 10 Feb 2014, 16:48

I am pretty sure there is not a function for playing actor HUD animations. It's probably more complicated. Here are files from GWR mod: https://www.mediafire.com/?rtdhcihg1hdye05
which add such a feature. I don't understand much from these files and I am wondering if it must be so complicated.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 17:07

Yeah, looks like you have to do some hacky things to play hud animations. Is there reason why you can't just use this?

Also I spotted typos:

Code: Select all

visual            = dynamics\devices\dev_ mineral_water\dev_ mineral_water.ogf


There is a space between dev_ and mineral_water in every instance this line is used. Unless it's intentional.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Swartz
Adventurer
Posts: 200
Joined: 27 May 2012, 08:37

Re: Using items

Postby Swartz » 10 Feb 2014, 17:07

There is no function for adding new HUD animations. I contacted Sin! about GWR a while back and asked the same question you have, and it turns out what you're seeing are for third person animations. HUD animations can't be done (until Gunslinger gets released anyway).

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 17:12

Swartz wrote:There is no function for adding new HUD animations. I contacted Sin! about GWR a while back and asked the same question you have, and it turns out what you're seeing are for third person animations. HUD animations can't be done (until Gunslinger gets released anyway).


How does Gunslinger do it? But if that were true about GWR than why are they activating the binoculars slot and using consumbale items with wpn_binoc as a base with special hud animations?
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Swartz
Adventurer
Posts: 200
Joined: 27 May 2012, 08:37

Re: Using items

Postby Swartz » 10 Feb 2014, 17:18

Alundaio wrote:
Swartz wrote:There is no function for adding new HUD animations. I contacted Sin! about GWR a while back and asked the same question you have, and it turns out what you're seeing are for third person animations. HUD animations can't be done (until Gunslinger gets released anyway).


How does Gunslinger do it? But if that were true about GWR than why are they activating the binoculars slot and using consumbale items with wpn_binoc as a base with special hud animations?


Gunslinger is doing it via a new dll written in Delphi that he's using to inject new functions into the game. !Sin wouldn't be more specific than that.

As for that script, I should have downloaded it before saying anything, I thought he was reffering to a different GWR script.
I have no idea how the script is doing, I'm just passing along what he had told me.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 17:21

Gunslinger is doing it via a new dll written in Delphi that he's using to inject new functions into the game.


Now that sounds like sorcery. Is he keeping it all to himself until he releases his mod?
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Swartz
Adventurer
Posts: 200
Joined: 27 May 2012, 08:37

Re: Using items

Postby Swartz » 10 Feb 2014, 17:23

Alundaio wrote:
Gunslinger is doing it via a new dll written in Delphi that he's using to inject new functions into the game.


Now that sounds like sorcery. Is he keeping it all to himself until he releases his mod?


Indeed he is. I asked him if he'd release some functions early but he said no :(

You can view videos of some of the stuff being done on this guy's channel: http://www.youtube.com/user/WolfKOTTO

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 17:27

That's bullshit. I hate when people hold on to shit that can help the entire modding community like a dragon sitting on a pile of treasure.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

r_populik
Scavenger
Posts: 47
Joined: 07 Aug 2012, 03:22

Re: Using items

Postby r_populik » 10 Feb 2014, 17:52

Alundaio wrote:That's bullshit. I hate when people hold on to shit that can help the entire modding community like a dragon sitting on a pile of treasure.

Yeah, you are right, but probably they just want to exert the greatest impression, when their mod will be released. The fact is they are talented and they are making great stuff.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 10 Feb 2014, 18:14

WolfKOTTO wrote:Is made with scripts. We don't released it cause is made for gunslinger mod :)


Revolucas wrote:+WolfKOTTO Can you at least explain how it is done? Do you activate a fake consumable that is really a weapon to play the HUD animations or are you using dll injection to rewrite engine functions, like what xRay extensions does?

WolfKOTTO wrote:+Revolucas First. Is made on binocular class - wp_binoc. Can't say enything more cause i'm not programmer, is made by Sin! as you can see in description.


Looks like what those GWR scripts do is what they are using.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

ikdoemaarwat
Scavenger
Posts: 14
Joined: 10 Mar 2013, 14:45

Re: Using items

Postby ikdoemaarwat » 12 Feb 2014, 16:55

If you have additional hud models and at least a use animation, you can pretty much replicate it into the game ad infinitum. Am I not seeing the obvious here? You have the vodka/medkit using animations working right?

User avatar
Bangalore
Explorer
Posts: 640
Joined: 09 Jun 2012, 19:02
Contact:

Re: Using items

Postby Bangalore » 20 Apr 2014, 04:10

I just found this mod on AMK forums, but it's for SOC.

Hud for conserv, bred, PDA and vodka using by Akella-96 aka SvD:

http://yadi.sk/d/nZ9JlPRJMmYDT
"Some sort of pressure must exist; the artist exists because the world is not perfect. Art would be useless if the world were perfect, as man wouldn’t look for harmony but would simply live in it. Art is born out of an ill-designed world."

ddraig
Scavenger
Posts: 4
Joined: 02 Feb 2013, 05:17

Re: Using items

Postby ddraig » 15 Jun 2015, 10:50

Just thought I'd give my two cents.

Lost Alpha has this, kind of. There's several segments in game where they have the actor's hands showing, doing animations.

What I believe they do is they have created a special instance of the bolt weapon that has special draw/idle animations that do whatever they want the first person 'hands' to do.

They've then determined the time it take for the animation to finish, then they release that special weapon and go about normal.

http://pastebin.com/sA0Xvqsp

This is the code for the intro

The specific animations for the hands are as such:

Code: Select all

anim_show         = hands_show
anim_hide         = hands_hidden_once
anim_idle         = hands_transform_full_new
anim_playing      = hands_transform_full_new
anim_throw_begin   = hands_hidden
anim_throw_idle      = hands_hidden
anim_throw_act      = hands_hidden_once
anim_throw_end      = hands_hidden_once


It's very hacked in but it is technically possible with a bit of work.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 18 Jun 2015, 00:04

This wouldn't be too hard to do now with source. It's theoretically possible to play hud animation whenever you want or trigger an animation state without player input. For example, playing hud animation from script, if it exists, when the player uses an item. Is this something that is still in desire?


Here is a good example of what I can do, through lua:


Code: Select all

local itm = db.actor:active_item()
itm:play_hud_motion("anim_idle",true)


or

Code: Select all

itm:set_hud_item_state(2) -- eHiding state, which plays hiding anim
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Beacon
Scavenger
Posts: 3
Joined: 11 Dec 2012, 06:19

Re: Using items

Postby Beacon » 19 Jun 2015, 13:22

Yes please!

ikdoemaarwat
Scavenger
Posts: 14
Joined: 10 Mar 2013, 14:45

Re: Using items

Postby ikdoemaarwat » 21 Jun 2015, 19:14

This has been possible for years, been posted on gsc even.
Can you give me a random animation for testing, so I can check if I'm not a retard?

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Using items

Postby Alundaio » 21 Jun 2015, 20:14

It is not possible to play hud animations at will. You can make fake weapon items and replace their animations with you want to do. Then activate or deactivate them to trigger hiding/showing or idle animations. That is about it.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

ikdoemaarwat
Scavenger
Posts: 14
Joined: 10 Mar 2013, 14:45

Re: Using items

Postby ikdoemaarwat » 23 Jun 2015, 15:45

Can you give me an animation you can't trigger?
I'll post back the result.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests