Can't get this code to work

Grab your favourite IDE and tinker with the innards of game engines

Re: Can't get this code to work

Postby TechieUK on Sun Apr 28, 2013 6:30 pm

I'm not too familiar with the debugger. How exactly can it reveal crash causes? Does it print it somewhere?
Also know as WILLAM; TechieUK is my old name. If you see WILLAM on Steam or ModDB, it's me.
User avatar
TechieUK
Regular
Regular
 
Joined: Sat Apr 13, 2013 4:29 pm

Re: Can't get this code to work

Postby Corewarp on Sun Apr 28, 2013 6:37 pm

TechieUK wrote:That does seem to have fixed something. They can spawn without a crash. However, then only assume the form of the regular manhack model. I'm assuming the crash could even have been a problem with the watermelon.mdl


The Source Engine doesn't like it when you try to give improper models to NPCs.
Are you absolutely sure it's meant to work with a watermelon?
User avatar
Corewarp
Been Here A While
Been Here A While
 
Joined: Thu Mar 13, 2008 6:29 pm

Re: Can't get this code to work

Postby Sandern on Sun Apr 28, 2013 6:46 pm

TechieUK wrote:I'm not too familiar with the debugger. How exactly can it reveal crash causes? Does it print it somewhere?

Did you follow the instructions from VDC? You just run it from visual studio and when it crashes it will return to visual studio. You can then check the callstack.

You will be interested to see if crashes from the manhack code somewhere. For example, if it crashes on "PrecacheModel" or "SetModel", then the engine probably can't load the model (maybe it was compiled for a newer version of Source Engine?).
Sandern
Regular
Regular
 
Joined: Thu Jun 30, 2005 1:08 pm
Location: Netherlands

Re: Can't get this code to work

Postby TechieUK on Sun Apr 28, 2013 7:20 pm

OK then, I'll try the debugger.

About the prop, I'm going to try with the Valve one in props_junk instead of my own recompiled one. It should be OK with that one. I'm not sure if it's relevant, but in GMod I was able to model manipulate it onto a manhack so I was chased by watermelons.
Also know as WILLAM; TechieUK is my old name. If you see WILLAM on Steam or ModDB, it's me.
User avatar
TechieUK
Regular
Regular
 
Joined: Sat Apr 13, 2013 4:29 pm

Re: Can't get this code to work

Postby Stormy on Sun Apr 28, 2013 8:51 pm

I'm pretty sure that with NPC's the engine searches for certain animation sequences for events, like how the manhack opens its blades when it gets close to you. If you don't have these sequences present in the .mdl it will cause problems. I think Garrrrrrrys mod gets around this by discarding animations when you change the model or something.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Can't get this code to work

Postby Corewarp on Mon Apr 29, 2013 12:11 pm

Black_Stormy wrote:I'm pretty sure that with NPC's the engine searches for certain animation sequences for events, like how the manhack opens its blades when it gets close to you. If you don't have these sequences present in the .mdl it will cause problems. I think Garrrrrrrys mod gets around this by discarding animations when you change the model or something.


Stormy is right. GMod deals with NPCs and animations very differently(with a lot more lenience towards derpy model setups).

Regular Source shuts down more or less completely if you feed it a bogus model.
User avatar
Corewarp
Been Here A While
Been Here A While
 
Joined: Thu Mar 13, 2008 6:29 pm

Re: Can't get this code to work

Postby TechieUK on Mon Apr 29, 2013 2:10 pm

I think I'd be better off duplicating the Manhack NPC and having spawn codes for each different type. I was able to make one assume the form of G-Man before, so they can use other models.

However, I'm assuming npc_template_maker will randomly choose templates if you specify multiple with the same name?
Also know as WILLAM; TechieUK is my old name. If you see WILLAM on Steam or ModDB, it's me.
User avatar
TechieUK
Regular
Regular
 
Joined: Sat Apr 13, 2013 4:29 pm

Re: Can't get this code to work

Postby ScarT on Tue Apr 30, 2013 11:59 am

G-Man and all other humanoid models use the same skeleton thus can use the same animations (and do).
The watermelon is a physics prop with one bone (I haven't checked, I'm guessing) and the manhack is a relatively complicated model for its size. I wouldn't be surprised if the model is the problem.
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: Can't get this code to work

Postby kraid on Tue Apr 30, 2013 3:19 pm

You should rig the model to the manhack skeleton and compile it.
That way all the animations and bones are there, but they won't have any geometry connected to them.
The Melon will be rigged to the same bone as the main body of the manhack was.
Don't forget to change the physic model the same way and include the manhack animations into the .qc
Goldeneye Source v4.2.3
get it now and play for FREE!!!
http://www.goldeneyesource.net
kraid
Been Here A While
Been Here A While
 
Joined: Thu Jan 22, 2009 12:09 pm

Re: Can't get this code to work

Postby Stormy on Tue Apr 30, 2013 7:24 pm

studiomdl discards any bones that don't have at least one face rigged to them, so if you want to do it that way you'll have to create a few tiny floating triangles and rig one to each bone I think.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Can't get this code to work

Postby kraid on Wed May 01, 2013 5:19 am

I never had issues with that, i guess the important thing is that the model is set up as animated model, has the right animations applied that are called by code and is rigged to the same skeleton (or parts of it) used for the animations.

As for the tiny floating triangles thing, i don't think that would be necessary.
Goldeneye Source v4.2.3
get it now and play for FREE!!!
http://www.goldeneyesource.net
kraid
Been Here A While
Been Here A While
 
Joined: Thu Jan 22, 2009 12:09 pm

Re: Can't get this code to work

Postby TechieUK on Thu May 02, 2013 2:59 pm

I think I've finally got around it by making a new NPC.
Also know as WILLAM; TechieUK is my old name. If you see WILLAM on Steam or ModDB, it's me.
User avatar
TechieUK
Regular
Regular
 
Joined: Sat Apr 13, 2013 4:29 pm

Re: Can't get this code to work

Postby AniCator on Tue Feb 11, 2014 11:41 pm

In what scope is your 'modelnames' variable defined?

EDIT: Crap, I see I'm late to the party. ;)
AniCator
Dumpling
Dumpling
 
Joined: Sat Jul 28, 2012 10:51 am
Previous

Return to Programming

Who is online

Users browsing this forum: No registered users

cron