Inside3D!
     

Ogres?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Tue Oct 16, 2007 10:30 pm    Post subject: Ogres? Reply with quote

Guys, I'm running into a little trouble here. I'm adding ogres to my QW mod. Here's the code:

void() create_ogre =
{
local entity ogre, spawn_spot;

// start entity and place it in world
ogre = spawn();
spawn_spot = SelectSpawnPoint ();
ogre.origin = spawn_spot.origin + '0 0 1';
ogre.angles = spawn_spot.angles;
ogre.fixangle = TRUE;
spawn_tfog (ogre.origin);
spawn_tdeath (ogre.origin, ogre);

// set size and shape
setsize (ogre, VEC_HULL2_MIN, VEC_HULL2_MAX);
ogre.solid = SOLID_SLIDEBOX;
ogre.movetype = MOVETYPE_STEP;
setmodel(ogre, "progs/ogre.mdl");
ogre.flags = ogre.flags | FL_MONSTER;
ogre.takedamage = DAMAGE_AIM;

// define his animation
ogre.th_stand = ogre_stand1;
ogre.th_walk = ogre_walk1;
ogre.th_run = ogre_run1;
ogre.th_die = ogre_die;
ogre.th_melee = ogre_melee;
ogre.th_missile = ogre_nail1;
ogre.th_pain = ogre_pain;
ogre.health = 200;

// polish him up
ogre.classname = "monster_ogre";
ogre.ideal_yaw = bot.angles * '0 1 0';
ogre.yaw_speed = 120;
ogre.view_ofs = '0 0 22';
bprint("an ogre joins the game\n");

// begin his thinking
ogre.nextthink = time + 0.1 + random();
ogre.think = bot.th_walk;
};

The line in bold seems to be the problem. Here is the error:

Type mismatch for = (entity and void)

What does that mean?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Tue Oct 16, 2007 11:00 pm    Post subject: Reply with quote

I take it you want SelectSpawnPoint to return a position for the ogre to spawn at. spawn_spot should be declared as a vector (local vector spawn_spot) and the SelectSpawnPoint function should be declared as a vector as well, though I'm not quite sure if that's legal in QC, I forget.
_________________
woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Tue Oct 16, 2007 11:37 pm    Post subject: Reply with quote

SelectSpawnPoint() is in client.qc, if it is void() SelectSpawnPoint, change it to entity() SelectSpawnPoint.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Oct 17, 2007 12:18 am    Post subject: Reply with quote

Thanks guys, I'll give it a go!

It already is entity() SelectSpawnPoint = in client.qc Confused


Code:
I tried this:

  void() create_ogre =
{   
        local entity ogre;
        local vector spawn_spot;
        etc...


Now I get - type mismatch for = (vector and void) Confused
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Wed Oct 17, 2007 1:41 am    Post subject: Reply with quote

Maybe has another declaration of SelectSpawnPoint() instead of the function itself in client.qc.

SelectSpawnPoint() doesn't return a vector, it returns an entity, so keep spawn_spot an entity in create_ogre().

If you find void() behind SelectSpawn..., change it to entity().

The declaration might be above create_ogre().
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Oct 17, 2007 2:25 am    Post subject: Reply with quote

You tha man!
I had put - void() SelectSpawnPoint; in defs.qc! Razz
I changed it to entity()...

Got the ogre to spawn! Very Happy
He doesn't move Mad
He launches pineapples, turns, his feet move like he's walking but he doesn't go anywhere?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Wed Oct 17, 2007 1:40 pm    Post subject: Reply with quote

In create_ogre(), setsize() should be AFTER setmodel(), otherwise you may get funky bounding boxes, causing the ogre to get stuck.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Oct 18, 2007 3:46 am    Post subject: Reply with quote

Where would I be without you???
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Fri Oct 19, 2007 1:45 pm    Post subject: Reply with quote

I would imagine somewhere in the gulf, assuming his position in Brazil acts as a balancing act to keep you in New York. Magnetism and all that.
Back to top
View user's profile Send private message AIM Address
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Fri Oct 19, 2007 1:54 pm    Post subject: Reply with quote

'The' gulf?
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group