Ogres?
Moderator: InsideQC Admins
10 posts
• Page 1 of 1
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?
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: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
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.
-

Entar - Posts: 439
- Joined: Fri Nov 05, 2004 7:27 pm
- Location: At my computer
Thanks guys, I'll give it a go!
It already is entity() SelectSpawnPoint = in client.qc
Now I get - type mismatch for = (vector and void)
It already is entity() SelectSpawnPoint = in client.qc
- Code: Select all
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: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
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().
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().
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
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?
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: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
