Place_Model Problems

Discuss programming in the QuakeC language.
Post Reply
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Place_Model Problems

Post by ScatterBox »

Hello.. again :D I'm here worrying about place_model

I'm using this tutorial here: "http://www.quake-1.com/docs/quakesrc.org/48.html"

(A quite simple tutorial). But My model doesn't appear in game. I follow everything to a T. I set my key, and value in the map editor. When I get in game the console yells at me about there not being a spawn function.. but wait.. isn't place_model the spawn function?

On a side note. It seem that any model I try to place doesn't work. I'm not talking about in place_model... I made an exploding canon balls function. It was supposed to spawn the "balls", and when they where shot, they would explode and trigger a door. Well, they trigger the door when you shoot them (even though they're invisible) they just don't spawn.

This place_model not working is really slowing down the progress on the mod. :/ Any help is appreciated as always! :D

EDIT - I must also add that I'm not using the "self.touch" in the function. It just didn't seem necessary. I tried it with self.touch in the function but it still didn't work.
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Place_Model Problems

Post by drm_wayne »

Code: Select all

void() place_model =
{
	precache_model (self.model);
	setmodel (self, self.model);
	self.skin = self.skin;
};
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Post by ScatterBox »

drm_wayne wrote:

Code: Select all

void() place_model =
{
	precache_model (self.model);
	setmodel (self, self.model);
	self.skin = self.skin;
};
Didn't work.. :/
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Place_Model Problems

Post by ceriux »

ScatterBox wrote:
drm_wayne wrote:

Code: Select all

void() place_model =
{
	precache_model (self.model);
	setmodel (self, self.model);
	self.skin = self.skin;
};
Didn't work.. :/
iv had similar problems iv tried making something like this and the only way i could get the model to spawn is by directly setting the name.
Max_Salivan
Posts: 96
Joined: Thu Dec 15, 2011 1:00 pm

Re: Place_Model Problems

Post by Max_Salivan »

maybe wrong key and value parameters or model name?)

key: model
Value: progs/Quake.mdl
try mine :D

Code: Select all

void() model_touch =
{
local vector v;
local float yaw;
 
if (other.classname != "player")
        return;
if (other.groundentity == self )
        return;
if (other.origin_z + other.mins_z + 8 >= self.absmax_z)
{
        if ((!other.flags & FL_ONGROUND))
        other.flags = other.flags + FL_ONGROUND;
        return;
}
        v = self.origin - other.origin;
        yaw = vectoyaw( v );
        walkmove( yaw, frametime * 50 );
};

/*
Place model code
How to use:
add key "model" with value "path to model"
*/
void() place_model =
{
        self.movetype = MOVETYPE_STEP;
        self.solid = SOLID_BBOX;
        precache_model (self.model);
        setmodel (self, self.model);
        self.skin = 0;
        self.touch = model_touch;
};  
Sorry for my english :)
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Post by ScatterBox »

Max_Salivan wrote:maybe wrong key and value parameters or model name?)

key: model
Value: progs/Quake.mdl
try mine :D

Code: Select all

void() model_touch =
{
local vector v;
local float yaw;
 
if (other.classname != "player")
        return;
if (other.groundentity == self )
        return;
if (other.origin_z + other.mins_z + 8 >= self.absmax_z)
{
        if ((!other.flags & FL_ONGROUND))
        other.flags = other.flags + FL_ONGROUND;
        return;
}
        v = self.origin - other.origin;
        yaw = vectoyaw( v );
        walkmove( yaw, frametime * 50 );
};

/*
Place model code
How to use:
add key "model" with value "path to model"
*/
void() place_model =
{
        self.movetype = MOVETYPE_STEP;
        self.solid = SOLID_BBOX;
        precache_model (self.model);
        setmodel (self, self.model);
        self.skin = 0;
        self.touch = model_touch;
};  
This seemed promising!! But.. didn't work. I've rechecked the key and value several times. I'll post exactly what I get in the console. :

-------------------------------------

'Mapversion' is not a field
No spawn function for:

Editct 8:
Origin: '512.0 -384.0 -448.0'
Classname: Place_Model
Model: Progs/brkncan.mdl

VERSION 1.09 SERVER
---------------------------------------------------
Max_Salivan
Posts: 96
Joined: Thu Dec 15, 2011 1:00 pm

Re: Place_Model Problems

Post by Max_Salivan »

This suggests a map which requires a certain mod is loaded in standard Quake or the wrong mod directory....maybe
Sorry for my english :)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Place_Model Problems

Post by Spike »

quake is case sensitive. use lower case.
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Post by ScatterBox »

Spike wrote:quake is case sensitive. use lower case.
Still doesn't work. :x
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Place_Model Problems

Post by drm_wayne »

then you fucked up something.
All the codes posted here works for me, in qc1.06 and in scratch qc.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Place_Model Problems

Post by frag.machine »

hmmm create a new map (just a box), put a place_model on it and test.
If didn't work copy and paste the .map file here so we can take a look.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Post by ScatterBox »

frag.machine wrote:hmmm create a new map (just a box), put a place_model on it and test.
If didn't work copy and paste the .map file here so we can take a look.
http://www.sendspace.com/file/d0xnh4 Here ya go! :D
ScatterBox
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Post by ScatterBox »

LESSON LEARNED ALWAYS ADD YOUR NEWLY MADE .QC TO THE PROGS.SRC! :lol:
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Place_Model Problems

Post by frag.machine »

Yeah, its a good idea. :D
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Post Reply