View previous topic :: View next topic |
Author |
Message |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Tue Oct 16, 2007 10:30 pm Post subject: Ogres? |
|
|
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 |
|
 |
Entar

Joined: 05 Nov 2004 Posts: 422 Location: At my computer
|
Posted: Tue Oct 16, 2007 11:00 pm Post subject: |
|
|
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 |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Tue Oct 16, 2007 11:37 pm Post subject: |
|
|
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 |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Wed Oct 17, 2007 12:18 am Post subject: |
|
|
Thanks guys, I'll give it a go!
It already is entity() SelectSpawnPoint = in client.qc
Code: | I tried this:
void() create_ogre =
{
local entity ogre;
local vector spawn_spot;
etc... |
Now I get - type mismatch for = (vector and void)  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Wed Oct 17, 2007 1:41 am Post subject: |
|
|
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 |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Wed Oct 17, 2007 2:25 am Post subject: |
|
|
You tha man!
I had put - void() SelectSpawnPoint; in defs.qc!
I changed it to entity()...
Got the ogre to spawn!
He doesn't move
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 |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Wed Oct 17, 2007 1:40 pm Post subject: |
|
|
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 |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Thu Oct 18, 2007 3:46 am Post subject: |
|
|
Where would I be without you??? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
scar3crow Inside3D Staff

Joined: 18 Jan 2005 Posts: 837 Location: Las Vegas, NV
|
Posted: Fri Oct 19, 2007 1:45 pm Post subject: |
|
|
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 |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Fri Oct 19, 2007 1:54 pm Post subject: |
|
|
'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 |
|
 |
|