PDA

View Full Version : Spray (flat model)



RobsoN
12th February 2013, 15:33
Hello Developers,

I'm interested about "spray idea" for my new server. I think, I just need flat model and image for it, then just spawn model by script.
1.Is It possible?
2.Is there anyother way?
3.Have anyone flat model, or can someone do it for me(i think it dont take much time - I am not modeler btw).

Thanks, RobsoN.

kung foo man
12th February 2013, 16:00
Such a xmodel wouldn't "bend" over edges, so i would prefer you use fx-effect (like blood).

RobsoN
12th February 2013, 16:14
But for FX i need xmodel? Or only texture image?

Thanks for reply kung foo man .

kung foo man
12th February 2013, 16:30
You need one .efx-file for every logo and then execute it with playfx(). I've never did it myself, just can tell you how it should work technically.

(There is a thanks-button below each post ;D)

RobsoN
12th February 2013, 16:35
The problem is - how build fx. Im not good at that.

kung foo man
12th February 2013, 16:57
You need to install CoD2 Mod Tools, then you find CoD2_EffectsEd.exe in /bin/-folder of your CoD2-Installation.

How you can start:
- load blood.efx from some gore-mod into CoD2_EffectsEd.exe
- change some settings till its fitting (e.g. decrease shaders to only 1 - your later logo)
- swap the shader to your logo
- call the generated .efx with playfx() where you need it



playfx( <effect id >, <position of effect>, <forward vector>, <up vector> )

You might not be good at that, but you grow with your problems. Just keep trying, learning by doing.

RobsoN
12th February 2013, 17:47
I don't know why but the effect is rotating of player's eye.http://www.youtube.com/watch?v=geXxwvo3OlE&feature=youtu.be

kung foo man
12th February 2013, 19:17
For me it looks like a HUD, can you upload your test.iwd, so ppl can test?

RobsoN
12th February 2013, 20:08
Ofc,

fx spawn code:


self playFx(level.robsonTestEffect, self.origin);

fx precache:


level.robsonTestEffect = loadfx("fx/robson.efx");

IzNoGoD
12th February 2013, 21:31
i told you on xf about the 2 vectors and to read the docs on the playfx function.

Please do so.

Please also note the 2 vectors i talked about. They might be a tiny bit important when i notice them (twice)!

Tally
13th February 2013, 09:16
Ofc,

fx spawn code:


self playFx(level.robsonTestEffect, self.origin);

fx precache:


level.robsonTestEffect = loadfx("fx/robson.efx");

Using this code:


self playFX( <nameoffx>, <origin> );

Will incur a runtime error "unknown function". I don't know the technical name for it, but playFX() is one of those script functions which run independently of any entity - be that a world entity or a player entity. Entities cannot run it; they can only be assigned to it.

You will need to make a player flag out of it and assign it to the playfx() function like this:


self.test = playfx( <nameoffx>, <origin> );

RobsoN
13th February 2013, 13:11
Using this code:


self playFX( <nameoffx>, <origin> );

Will incur a runtime error "unknown function". I don't know the technical name for it, but playFX() is one of those script functions which run independently of any entity - be that a world entity or a player entity. Entities cannot run it; they can only be assigned to it.

You will need to make a player flag out of it and assign it to the playfx() function like this:


self.test = playfx( <nameoffx>, <origin> );

I'm sorry, while rewriting the script to this forum I just made ​​a mistake. Normally I have a correctly function without 'self' object.

To IzNoGod:

I got same problem with 2 vectors.

My code:


_spray()
{
//while( !self useButtonPressed() )
//wait .2;


angles = self getPlayerAngles();
eye = self getEye();
forward = eye + maps\mp\_utility::vectorScale( anglesToForward( angles ), 70 );
trace = bulletTrace( eye, forward, false, self );

iprintln("fr:"+ trace["fraction"]);

if( trace["fraction"] == 1 )
{
iprintln("return");
return;
}

position = trace["position"] - maps\mp\_utility::vectorScale( anglesToForward( angles ), -2 );
angles = vectorToAngles( eye - position );
forward = anglesToForward( angles );
up = anglesToUp( angles );

playFx( level.testfx, position, forward, up );
//self playSound
}

This isn't effect problem maybe..?

Thanks for reply.