Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

SUB_regen... its there but wont do it

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 1:05 am Post subject: SUB_regen... its there but wont do it |

i have been doing teh AIcafe` stuff but when i do the monster item roam it has a sub regen in it and frik gui has no idea what i doing say like this :

Code:
//~~~~~~~~~~~~~~~~~~~~~ void() bot_grab_items = //~~~~~~~~~~~~~~~~~~~~~ { if (self.goalentity == world)
return;
if (vlen(self.origin - self.goalentity.origin) <= 70)
{
self.goalentity.solid = SOLID_NOT;
self.goalentity.model = string_null;
self.goalentity.nextthink = time + 20;
self.goalentity.think = SUB_regen;
if (self.goalentity.healamount)
sound(self, CHAN_ITEM,"items/health1.wav", 1,ATTN_NORM);
else if (self.goalentity.weapon)
sound(self, CHAN_ITEM,"weapons/pkup.wav", 1,ATTN_NORM);
else
sound(self, CHAN_ITEM,"items/armor1.wav", 1,ATTN_NORM);
self.goalentity = world;
}
};

Quote:
ya and i get this warning [quotewarning: Q206: subs.qc:25:SetMovedir: not all control paths return a value warning: Q116: fight.qc:299:Local enemy_yaw redeclared warning: Q202: ai.qc:368:FindTarget must return a value error: Q505: ai.qc:479:Unknown value "SUB_regen"
warning: Q202: ai.qc:630:CheckAnyAttack must return a value]

ooooh a 505 :p gross
i am doing exactly as it says in tutorial and keeps getting this
i also get a diffrent one with the knight and the monster improvements where it stops the game and gives me a host error, but thats for lator [im still new to this modding..and quake in general][/quote]
_________________
bah

Back to top |

Electro Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia |

Posted: Thu Jul 17, 2008 1:17 am Post subject: |

progs.src determines the order the compiler actually compiles the qc files. When a function (or anything really) is unknown, it means it hasn't been declared/defined yet. So in this case, you're trying to use SUB_regen before it is actually declared, meaning that your bot file is being compiled BEFORE SUB_regen even exists (items.qc would be further down in your progs.src)
To fix this, you can let the compiler know what the function is, and that it will be defined later on by doing:

Code:
void() SUB_regen;

Put this above your bot_grab_items function. Be careful not to do this for functions that don't actually exist, because the compiler will spit errors at you more than a camel.
_________________
Unit reporting!
http://www.bendarling.net/

Back to top |

CocoT Joined: 14 Dec 2004 Posts: 599 Location: Belly-Gum |

Posted: Thu Jul 17, 2008 3:19 am Post subject: |

_________________ http://www.planetcocot.net/

Back to top |

Electro Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia |

Posted: Thu Jul 17, 2008 4:25 am Post subject: |

haha see! It's watching you MeTcHsteekle O_O Even has the spit ready. _________________ Unit reporting! http://www.bendarling.net/

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 5:06 am Post subject: |

heh gross thanks guys it worked i moved items above ai cos i got more errors its a nice one cos the monsters that are to guard stay put most of time and the "fillers" roam _________________ bah

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 5:47 am Post subject: |

ok now gots everything roaming round wooooooo but i hast cought the error with the knight and the "improved monster ai" in deed it is improved but the knoght will stop game and gives this error

Quote:
===== Output on Gyro frame: 3812 ===== You got the Double-barrelled Shotgun You receive 25 health You got armor You got the shells
You got the shells
You got armor
CALL0 5366(?]
ai.qc : ai_run
knight.qc : knight_run7
<NO FUNCTION>
NULL function
===========================
Host_Error: Program error
===========================
]condump

i guess somthing to do with this

Code:
void() knight_run1 =[ $runb1, knight_run2 ] { if (random() < 0.2) sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); ai_run(16);}; void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);};
void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);};
void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);};
void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);};
void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);};
void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);};
void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);};

i guess i could replace the knight completlty with the grumbler [not init yet] but i happen to like the knight, so i dont know wut ta do
oh ya the tutorial is http://minion.planetquake.gamespy.com/tutorial/tutor2.htm
meh thinks...somthing
just ran it again and got similar but diffrent

Quote:
You receive 25 health You got armor You got the shells CALL0 5429(?] ai.qc : ai_run
knight.qc : knight_run5
<NO FUNCTION>
NULL function
===========================
Host_Error: Program error
===========================
]condump

this time i also have http://minion.planetquake.gamespy.com/tutorial/fastmons.htm on it also .. damn u knight why do u have to be so cool but not work
_________________
bah

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 6:33 am Post subject: |

perhaps there is a way to have the knoght void these feature? like if classname == kinght return? i just noticed this in the frikgui

Quote:
warning: Q206: subs.qc:25:SetMovedir: not all control paths return a value warning: Q116: fight.qc:343:Local enemy_yaw redeclared warning: Q105: items.qc:47:droptofloor: Too few parameters. See definition defs.qc(602) warning: Q202: ai.qc:368:FindTarget must return a value
warning: Q202: ai.qc:631:CheckAnyAttack must return a value
warning: Q105: ai.qc:773:ai_back: Too few parameters. See definition ai.qc(430)warning: Q116: weapons.qc:92:Local org redeclared
warning: Q206: client.qc:134:FindIntermission: not all control paths return a value
warning: Q105: monsters.qc:75:droptofloor: Too few parameters. See definition defs.qc(602)
warning: Q205: misc.qc:179:No operation performed
warning: Q105: misc.qc:249:droptofloor: Too few parameters. See definition defs.qc(602)
warning: Q105: misc.qc:281:droptofloor: Too few parameters. See definition defs.qc(602)
warning: Q105: misc.qc:536:makestatic: Too few parameters. See definition defs.qc(650)
warning: Q105: ogre.qc:305:ai_charge: Too few parameters. See definition fight.qc(201)
warning: Q105: soldier.qc:206:W_FireSpikes: Too few parameters. See definition weapons.qc(655)
warning: Q105: soldier.qc:211:W_FireSpikes: Too few parameters. See definition weapons.qc(655)
warning: Q206: wizard.qc:180:WizardAttackFinished: not all control paths return a value
warning: Q116: enforcer.qc:76:Local vec redeclared

thres alot i know, but perhaps that back one is a problem?
_________________
bah

Back to top |

FrikaC Site Admin Joined: 08 Oct 2004 Posts: 947 |

Posted: Thu Jul 17, 2008 4:18 pm Post subject: |

Quote:
You receive 25 health You got armor You got the shells CALL0 5429(?] ai.qc : ai_run
knight.qc : knight_run5
<NO FUNCTION>
NULL function
===========================
Host_Error: Program error
===========================
]condump

This callstack means ai_run in ai.qc tried to call a function that doesn't exist. Likely, it's one of the .th_* fields you didn't fill in (ala th_pain or something.
As far as the warnings, they all look normal.

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 5:48 pm Post subject: |

...ok its only happing with the knights tho

Code:
/* ============= ai_run The monster has an enemy it is trying to kill =============
*/
void(float dist) ai_run =
{
local vector delta;
local float axis;
local float direct, ang_rint, ang_floor, ang_ceil;
movedist = dist;
// see if the enemy is dead
if (self.enemy.health <= 0)
{
self.enemy = world;
// FIXME: look all around for other targets
if (self.oldenemy.health > 0)
{
self.enemy = self.oldenemy;
HuntTarget ();
}
else
{
if (self.movetarget)
self.th_walk ();
else
self.th_stand ();
return;
}
}
self.show_hostile = time + 1; // wake up other monsters
// check knowledge of enemy
enemy_vis = visible(self.enemy);
if (enemy_vis)
self.search_time = time + 5;
// look for other coop players
if (coop && self.search_time < time)
{
if (FindTarget ())
return;
}
enemy_infront = infront(self.enemy);
enemy_range = range(self.enemy);
enemy_yaw = vectoyaw(self.enemy.origin - self.origin);
if(time < self.enemy.attack_finished)
{
ai_run_slide();
return;
}
if(self.health < 25)
{
ai_back();
self.th_missile();
return;
}
if (self.attack_state == AS_MISSILE)
{
//dprint ("ai_run_missile\n");
ai_run_missile ();
return;
}
if (self.attack_state == AS_MELEE)
{
//dprint ("ai_run_melee\n");
ai_run_melee ();
return;
}
if (CheckAnyAttack ())
return; // beginning an attack
if (self.attack_state == AS_SLIDING)
{
ai_run_slide ();
return;
}
// head straight in
movetogoal (dist); // done in C code...
makevectors(self.angles);
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.velocity = v_forward * 200;
};

it seemes to happen when it attacks and has a corilation with the run anim. sequence
hmmm or i think, as i skimm thru knight qc it has no missile attack but only a melee and seeing the code above i se missile and run r liknked by ai_run_missile (); but then there is the melee right after that...so it cant be a problem? other wise soldier would crash it to because there is no melee for hmm :/ ill keep looking thru tho
_________________
bah

Back to top |

FrikaC Site Admin Joined: 08 Oct 2004 Posts: 947 |

Posted: Thu Jul 17, 2008 7:11 pm Post subject: |

MeTcHsteekle wrote:
...ok its only happing with the knights tho

Okay the three th_ functions it calls are th_missile, th_walk and th_stand. Look in the spawn function for the enemy (monster_knight?) and see if those are filled in with something.

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Thu Jul 17, 2008 7:34 pm Post subject: |

i think these are them and this is wut i got

Code:
self.health = 75; self.th_stand = knight_stand1; self.th_walk = knight_walk1; self.th_run = knight_run1; self.th_melee = knight_atk1;
self.th_pain = knight_pain;
self.th_die = knight_die;
walkmonster_start ();
Gyro_Object_Activate(self, 190);
Gyro_Object_SetBouyancy(self, 190*1.2);

ugh grabed a bit too much ill look for more of these and compare i
guess
//edit, i killed the problem
what caused the crash was when a monsters health was 25 or lower it would retreat and shoot at same time but fer some odd reason the knight does not have a th._missile so it coulden't shoot so it read that first i guess and messed it up
so i just removed the retreat {or ai_back} completly, thanks for helping me look at the th's
_________________
bah

Back to top |

Display posts from previous:

| 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