Forum

Half life like (Half like?) world interaction

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Half life like (Half like?) world interaction

Postby toneddu2000 » Wed May 04, 2011 11:30 am

I was unsure to post this thread in mapping or qc section because it depends on them both. The strength of Half life and half life2, as you know, is the large amount of ingame intermission scenes (a scientist been dragged by a monster in a service duct, marines squad arriving in formation and killing scientists, npc characters talking with player) and a REAL story. I was thinking if it could be done in quakec (for what I know GoldenSrc is quake engine heavily modified so...) and if anyone of you has never made some attempt. For my game I'd like to create some intermission scenes where there's a "trigger" in a map that once activated(passing trough,for example) "something" happens (I'd like to create an entire scene in blender, export it as a global animated model and "linked" to the entity).
What do you think? Is it possible?
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby leileilol » Wed May 04, 2011 11:59 am

SPOILERS: Half-Life and Half-Life 2 are pre-choreographed in 3DSMax and Softimage XSI (respectively)

What they're doing is just playing a scripted sequence. How it's made was the mapper usually exported a dxf file of the map, which is brought into 3dsmax, where your poor scientist.mdl is animated by hand to that level so it looks like it's interacting with it

this works best on skeletal animation. vertex animation doing scripted sequences would be very limited and bad looking (especially considering the 'distance' limitations of md3 as well
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby toneddu2000 » Wed May 04, 2011 2:37 pm

Thanks a lot leileilol for the clarification! Unfortunately I will be forced to use interpolated models (maybe md3) because I can't use csqc for skeletal animation (neither I'm good at quakec nor I found any good tutorial about it). The only problem is: how to activate that animation? I could create in NetRadiant an entity called intermission_animation1 and then I could create a intermission_animation1.qc where I simply put the reference of the scene + animations. However I completely ignore how to "make the animation starts" when the entity is triggered
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby frag.machine » Thu May 05, 2011 1:50 am

toneddu2000 wrote:Thanks a lot leileilol for the clarification! Unfortunately I will be forced to use interpolated models (maybe md3) because I can't use csqc for skeletal animation (neither I'm good at quakec nor I found any good tutorial about it). The only problem is: how to activate that animation? I could create in NetRadiant an entity called intermission_animation1 and then I could create a intermission_animation1.qc where I simply put the reference of the scene + animations. However I completely ignore how to "make the animation starts" when the entity is triggered


Firing the scripted sequence is maybe the easiest part: use a trigger_once to fire your actor entity when the player reaches the designed place into the map.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby toneddu2000 » Thu May 05, 2011 11:41 am

trigger_once, huh? I'll try it, thanks! Any special advice about how to use it?
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby Nahuel » Thu May 05, 2011 1:12 pm

toneddu2000 wrote:trigger_once, huh? I'll try it, thanks! Any special advice about how to use it?

you can use trigger_once or trigger_multiple with "wait-1". You realize a complex animation. My code of "dog ghost " perhaps serves to you. It is very simple; any event activate the "dog ghost"; with a multiple trigger (with wait-1 ) with trigger_once or even with a button. as any thing activable!

Code: Select all
void() dghost1   =[   61,      dghost2   ] {};
void() dghost2   =[   62,      dghost3   ]{
   makevectors (self.angles);
   self.origin_z = self.origin_z + 1;
   self.velocity = v_forward * 300 + '0 0 200';
sound (self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM);

};
void() dghost3   =[   63,      dghost4   ] {};
void() dghost4   =[   64,      dghost5   ] {};
void() dghost5   =[   65,      dghost6   ] {self.alpha = 0.9;};
void() dghost6   =[   66,      dghost7   ] {self.alpha = 0.7;};
void() dghost7   =[   67,      dghost8   ] {self.alpha = 0.5;};
void() dghost8   =[   68,      dghost9   ] {self.alpha = 0.3;};
void() dghost9   =[   69,      SUB_Remove   ] {self.alpha = 0.1;};
void() Becomedoghost =
{
   self.movetype = MOVETYPE_TOSS;
   self.velocity = '0 0 0';
   self.touch = SUB_Null;
   setmodel (self, "progs/dog.mdl");
   self.solid = SOLID_NOT;
   dghost1 ();
};


void() play_doghost =
{
   
   precache_model ("progs/dog.mdl");

   precache_sound ("dog/dattack1.wav");

   self.use = Becomedoghost;
};



this " dog ghost" jumps according to the angle, barks and disappears... it is simple... I believe that you should write a similar function (although more complex and with more frames).
the key is in "Becomedoghost" there it will have to put your model and in the dghost... your frames with his corresponding times and sounds.
If you want to test the dog it is easy, call "play_doghost" from a button and look it.
Remember to declare ".float alpha;" in dpextensions.qc
Last edited by Nahuel on Sun May 08, 2011 12:51 am, edited 1 time in total.
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby toneddu2000 » Thu May 05, 2011 4:05 pm

Very kind as always, Nahuel! Just a doubt: when you say
If you want to test the dog it is easy, call "play_doghost" from a button and look it.

for Button you intend a button in radiant editor or quakec? Or is an option of the trigger_once in the radiant editor?
Thanks again
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby Nahuel » Thu May 05, 2011 4:18 pm

toneddu2000 wrote:Very kind as always, Nahuel! Just a doubt: when you say
If you want to test the dog it is easy, call "play_doghost" from a button and look it.

for Button you intend a button in radiant editor or quakec? Or is an option of the trigger_once in the radiant editor?
Thanks again


func_button!
I use quark, a simple button or trigger_multiple :?

for example!
func_button with target "x"
play_doghost with targetname "x"
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby toneddu2000 » Thu May 05, 2011 4:49 pm

Ok thanks a lot Nahuel!! For me it's the first time I dig into quakec entity creation, so I'm a little slow in comprehension! :D
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby toneddu2000 » Sat May 07, 2011 9:59 pm

It worked like a charm, thanks you all guys!

I just describe briefly what I did if there's someone newbber than me at quakec (difficult but possible :) )who's trying to do something similar


First of all I created a func_button with key target and value act1 then I created an entity (I used a player start and changed after the classname)with classname play_doghost and targetname act1

I make target and targetname bold just because they at first seemed to me difficult to understand!

a line will appear to emphasize the connection between the func_button and the entity

the code Nahuel kindly posted is autoexplanatory: the play_doghost function is called inside the editor and executed

Thanks again folks!!
toneddu2000
 
Posts: 1352
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest