D
Dr_Fripp
Guest
The question I have here is pretty much related to the topic of AI coding on this board:
AI Code
I want to do something like this, but I want to do it in MP-style: I need an AI team to fight human players of another team. Let's say a co-operative gamestyle is okay, but I really need to do it in MP because I want to evolve it into something different later on.
I have read about the necessity to add relationships to the relationship table in hl2_gamerules.cpp, and alter the Classify() function.
However, in the MP SDK I'm dealing with the sdk_gamerules.cpp, which only happens to have a function for deciding the relationship among players.
So I tried to simply add the InitDefaultAIRelationships function to the sdk_gamerules, and import the headcrab.cpp for a temporary simple AI entity (commenting everything out that generates problems with compiling). However, both the Classify() in headcrab.cpp and the SetDefaultRelationship() in the gamerules need definitions for the CLASS_HEADCRAB. These classes are defined in baseentity.cpp, but this file is not readily accessible in the MP SDK. Even after managing to #include "../../dlls/baseentity.h" (!!), an awful lot of problems result at compiling.
(Furthermore, half of the header files are in the "game_shared" dir, and the other half in the "dlls" dir, and this causes the compiler to not find included files sometimes. This is another hurdle in trying to include files from the SP SDK to the MP SDK.)
I feel I need those relationships in MP, but I just can't get them imported in an easy way. Am I doing something wrong, or is my approach totally off? Any help would be appreciated.
Thanks in advance.
AI Code
I want to do something like this, but I want to do it in MP-style: I need an AI team to fight human players of another team. Let's say a co-operative gamestyle is okay, but I really need to do it in MP because I want to evolve it into something different later on.
I have read about the necessity to add relationships to the relationship table in hl2_gamerules.cpp, and alter the Classify() function.
However, in the MP SDK I'm dealing with the sdk_gamerules.cpp, which only happens to have a function for deciding the relationship among players.
So I tried to simply add the InitDefaultAIRelationships function to the sdk_gamerules, and import the headcrab.cpp for a temporary simple AI entity (commenting everything out that generates problems with compiling). However, both the Classify() in headcrab.cpp and the SetDefaultRelationship() in the gamerules need definitions for the CLASS_HEADCRAB. These classes are defined in baseentity.cpp, but this file is not readily accessible in the MP SDK. Even after managing to #include "../../dlls/baseentity.h" (!!), an awful lot of problems result at compiling.
(Furthermore, half of the header files are in the "game_shared" dir, and the other half in the "dlls" dir, and this causes the compiler to not find included files sometimes. This is another hurdle in trying to include files from the SP SDK to the MP SDK.)
I feel I need those relationships in MP, but I just can't get them imported in an easy way. Am I doing something wrong, or is my approach totally off? Any help would be appreciated.
Thanks in advance.