Forum

2 simple (i promise) questions

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

2 simple (i promise) questions

Postby Ghost_Fang » Thu Jan 21, 2010 7:41 am

Ok really simple, again, im only asking cause of the lack of my .qc syntax knowledge.

1.When i shoot i wanna spawn a model.spr sprite for a muzzle flash.
Whats the code that creates a model, and how would i set it for like a split second.

2. Broken animation, i replaced an enemy model with my own, i matched every frame perfectly, even the names. But when i kill them, they play the death sequence perfectly, but then pop right back up to death1 frame (but they are still dead) how would i fix this?

Thanks in advance
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby c0burn » Thu Jan 21, 2010 7:44 am

1) spawn()

2) The simple answer is you didn't match it.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby ceriux » Thu Jan 21, 2010 8:16 am

also might want to check out the grenade launcher code or the rocket launcher. its almost exactly what you want. the just use what ever they use to set the grenade code and replace the grenade.mdl with your sprite.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Error » Thu Jan 21, 2010 11:41 am

question 2)

c0burn is right, you didn't match the frames exactly. let me make some points about frames:

1. using $stand1 style frame macro things does not have anything to do with the naming of frames in models

2. frame groups (as seen in your model editor), don't matter at all, even the names of them, while coding

Example:
Image
Now, in this image you see all these frames.

In QC, you would use frame macros like this:
Code: Select all
//
// running
//
$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6

$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6


"$axrun1" is actually equal to frame number 0, as axrun3 would equal frame number 2.

the order of the frames is what matters. if there is any frame before $axrun1 in your model, it then would turn into $axrun1 or frame number 0.

I'm officially tired and probably didn't get that out right. can someone please help or clarify?
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Ghost_Fang » Thu Jan 21, 2010 2:53 pm

I have already given Ceriux my model, he took a look at it and he even said the frames match up perfectly

edit: i fixed it, i needed to add a frame, but still, i matched it up, even ask Ceriux.


Edit2: I looked and looked at both missile functions and i cant quite figure out how to manipulate it for my muzzle flash. it has a lot of all this extra stuff. How would i go about defining a new entity? would it be something like this??

.string mflash =
setmodel ("misc/mflash.spr")
setorigin (0, 0, 0)

Like that? lol, im lost atm.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest