Forum

Place_Model Problems

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Place_Model Problems

Postby ScatterBox » Sun Nov 03, 2013 6:59 pm

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.
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby drm_wayne » Sun Nov 03, 2013 9:38 pm

Code: Select all
void() place_model =
{
   precache_model (self.model);
   setmodel (self, self.model);
   self.skin = self.skin;
};
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Place_Model Problems

Postby ScatterBox » Sun Nov 03, 2013 11:39 pm

drm_wayne wrote:
Code: Select all
void() place_model =
{
   precache_model (self.model);
   setmodel (self, self.model);
   self.skin = self.skin;
};


Didn't work.. :/
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby ceriux » Mon Nov 04, 2013 6:22 am

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.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Place_Model Problems

Postby Max_Salivan » Mon Nov 04, 2013 10:29 am

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 :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Place_Model Problems

Postby ScatterBox » Mon Nov 04, 2013 11:28 am

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
---------------------------------------------------
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby Max_Salivan » Mon Nov 04, 2013 11:48 am

This suggests a map which requires a certain mod is loaded in standard Quake or the wrong mod directory....maybe
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Place_Model Problems

Postby Spike » Mon Nov 04, 2013 12:26 pm

quake is case sensitive. use lower case.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Place_Model Problems

Postby ScatterBox » Mon Nov 04, 2013 8:01 pm

Spike wrote:quake is case sensitive. use lower case.


Still doesn't work. :x
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby drm_wayne » Mon Nov 04, 2013 10:04 pm

then you fucked up something.
All the codes posted here works for me, in qc1.06 and in scratch qc.
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Place_Model Problems

Postby frag.machine » Mon Nov 04, 2013 11:03 pm

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Place_Model Problems

Postby ScatterBox » Tue Nov 05, 2013 12:02 am

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
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby ScatterBox » Tue Nov 05, 2013 4:39 am

LESSON LEARNED ALWAYS ADD YOUR NEWLY MADE .QC TO THE PROGS.SRC! :lol:
User avatar
ScatterBox
 
Posts: 50
Joined: Sun Oct 13, 2013 7:53 pm

Re: Place_Model Problems

Postby frag.machine » Tue Nov 05, 2013 11:16 am

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest