Новые сообщения Участники Правила Поиск
Модератор форума: freeknik, SLAwww, thecre, RealCrazyMan  
Форум » Serious Sam » Серьёзное редактирование » Помощь по SDK для Serious Sam 1.05/1.07 (Вопросы по комплекту средств разработки для Serious Sam 1.)
Помощь по SDK для Serious Sam 1.05/1.07
SLAwww Пятница, 28.12.2012, 22:30 | Сообщение # 1711


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Это виртуальный метод CEntity для переопределения параметров затенения модели. В CEnemyBase, например, он перегружен (строка 780).

SeriousAlexej, GetLerpedPlacement возвращает усреднённое месторасположение между двумя отсчётами таймера. А у какого объекта неправильно работает GetPlacement? У игрока? У других объектов работает правильно?


Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
SeriousAlexej Суббота, 29.12.2012, 00:47 | Сообщение # 1712


Serious Editor
Сообщений: 1245
Награды: 52
Замечания: 0%
 
Да, у игрока. У других вроде-бы все правильно.

XFighter Суббота, 29.12.2012, 10:30 | Сообщение # 1713


Сообщений: 20
Награды: 0
Замечания: 20%
 
SLAwww, спасибо :D

Добавлено (29.12.2012, 10:30)
---------------------------------------------
а теперь у меня есть такой вопрос
У меня есть радар, но он ловит врагов на близком расстоянии, а мне надо чтобы он их ловил с дальнего расстояния, но при этом не выежая за края радара.
вот код радара: это туториал Armern'a.
// draw radar
{FOREACHINDYNAMICCONTAINER(((CEntity&)*_penPlayer).GetWorld()->wo_cenEntities, CEntity, iten) { // For every entity in the level
CEntity *pen = iten;
if (IsDerivedFromClass(pen, "Enemy Base")) { // if entity is an Enemy Base
CEnemyBase *penEnemy = (CEnemyBase *)pen; // basicly we make a new enemy thing, Hey I may not know how to explain it, but atleast I know what it does.. hehe
if (penEnemy->m_penEnemy==NULL) {
continue;
}

CPlacement3D plEnemy; // we make a new placement thing
plEnemy.pl_PositionVector=penEnemy->GetPlacement().pl_PositionVector; // get the position of this enemy (
plEnemy.pl_OrientationAngle=FLOAT3D(0,0,0); // set it to 0,0,0 for now.
plEnemy.AbsoluteToRelativeSmooth(((CEntity&)*_penPlayer).GetPlacement()); // get it's position relative to the position of the player. It's a bunch of maths...

FLOAT EnemyOnHudX=plEnemy.pl_PositionVector(1); // X position of the enemy (dot) relative to the player
FLOAT EnemyOnHudY=plEnemy.pl_PositionVector(3);// Y position of the enemy (dot) relative to the player
FLOAT posX = EnemyOnHudX*2.5+_pDP->GetWidth()-128; // in my radar, the center of my radar is 128 pixels from the side
FLOAT posY = EnemyOnHudY*2.5+_pDP->GetHeight()-128;// and 128 pixels from the bottom. Also, you can set the 2.5 to different amounts. A higher number means a wider range the radar will show. I'm not good at explaining maths, so you'll have to take it for granted.. sorry :).
FLOAT fRadarRadius = 48.5f; // the radius of the radar in meters (SEd units)..
COLOR colRdot = C_WHITE|255;
FLOAT m_fEnemyHealth = 0.0f;

m_fEnemyHealth = ((CEnemyBase*)pen)->GetHealth() / ((CEnemyBase*)pen)->m_fMaxHealth; // Get the health of this enemy

if( (penEnemy->GetPlacement().pl_PositionVector - ((CEntity&)*_penPlayer).GetPlacement().pl_PositionVector ).Length() < fRadarRadius ) // if the enemy is less than 24 meters away from the player
{
colRdot = C_GREEN|255; // give the dot a green colour
if( m_fEnemyHealth<0.25f) { colRdot = C_RED|255; } // whoops, he's allmost dead. this is to check if it's health is lower than 25.
else if( m_fEnemyHealth<0.60f) { colRdot = C_YELLOW|255; } // if it's a little lower, make it yellow
else if( m_fEnemyHealth<0.01f) { colRdot = C_RED|0; } // I added this for my own test, but it appears not to always work. I want the dot to dissapear when an enemy is basicly dead.. for some reason it's health never becomes this low when he's dead?
else { colRdot = C_GREEN|255; } // or else, his health is pretty high, so he may stay green.
} else
{
colRdot = C_WHITE|0; // if his position relative to the player is more than 24 meters, make it invisible.
}

_pDP->InitTexture(&_rDot); // Here we intialize the dot texture
_pDP->AddTexture(posX-8/2,posY-8/2,posX+8/2,posY+8/2, colRdot); // we place it at the correct position. We must tell it to substract half the image size for the left, half at the top, and add half to the bottom and right, or else you wouldn't see a dot (texture) at all.
_pDP->FlushRenderingQueue();

}
}}
Сообщение отредактировал XFighter - Суббота, 29.12.2012, 12:55


SLAwww Суббота, 29.12.2012, 18:04 | Сообщение # 1714


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
XFighter, в комментариях к коду всё написано, прочитай внимательно.
SeriousAlexej, вероятно, GetPlacement у сервера и у клиента вызываются несинхронно, или на чём-то отразилась применённая где-то функция FRnd/Rnd.


Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
XFighter Суббота, 29.12.2012, 19:06 | Сообщение # 1715


Сообщений: 20
Награды: 0
Замечания: 20%
 
SLAwww, ок :D

Heming_Hitrowski Суббота, 29.12.2012, 19:12 | Сообщение # 1716


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
помогите составить условие, пожалуйста
если у игрока в руках m_icurrentweapon и больше никакого оружия нет кроме него в инвентаре


SLAwww Суббота, 29.12.2012, 19:31 | Сообщение # 1717


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
if( !( m_iAvailableWeapons & ( !( 1<< (m_icurrentweapon-1) ) ) ) )

Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
Heming_Hitrowski Воскресенье, 30.12.2012, 12:18 | Сообщение # 1718


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
Спасибо.

seriously_petr Воскресенье, 30.12.2012, 13:38 | Сообщение # 1719


Сообщений: 446
Награды: 4
Замечания: 0%
 
Всем привет. У друга проблемка возникла :D

Хотел он сделать зорга-огнемётчика, да вылетает игра при стрельбе. Пробовали всё что можно, код крутили, но всё безрезультатно.

Мы сдаёмся и кидаем код вам, может вы найдёте ошибку.


SLAwww Воскресенье, 30.12.2012, 18:03 | Сообщение # 1720


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Интересный у вас код.

Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
XFighter Воскресенье, 30.12.2012, 19:41 | Сообщение # 1721


Сообщений: 20
Награды: 0
Замечания: 20%
 
SLAwww, :DD

seriously_petr Воскресенье, 30.12.2012, 19:49 | Сообщение # 1722


Сообщений: 446
Награды: 4
Замечания: 0%
 
SLAwww, Вот блин, ссыль то я забыл пихнуть :D

>>> Вот <<<
Сообщение отредактировал seriously_petr - Воскресенье, 30.12.2012, 19:51


GranMinigun Воскресенье, 30.12.2012, 20:56 | Сообщение # 1723


Сообщений: 1145
Награды: 5
Замечания: 0%
 
Товарищи, очень прошу - не используйте слишком светлые цвета! Их на белом фоне хрен разглядишь!

SLAwww Воскресенье, 30.12.2012, 22:09 | Сообщение # 1724


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Не знаю, в чём дело, вот, попробуй прилепить это вместо своей процедуры огня:
Код
  FirebugAttack(EVoid) {
     StandingAnimFight();
  StartModelAnim(GRUNT_ANIM_FIRE, 0);
  PlaySound(m_soFire2, SOUND_FIREBUG_START, SOF_3D);
  autocall FirebugAttackStart() EReturn;    
     autowait(FRnd()*0.333f);
     return EEnd();
   };

   FirebugAttackStart(EVoid) {
  m_iFlameTime=0;
  PlaySound(m_soFire1, SOUND_FIREBUG, SOF_3D|SOF_LOOP);
     while(m_iFlameTime<20) {
   CPlacement3D plFlameSource=GetPlacement();
   CPlacement3D plEnemy=CPlacement3D(FLOAT3D(0,0,0),ANGLE3D(0,0,0));
   if(m_penEnemy!=NULL) {
    plEnemy=m_penEnemy->GetPlacement();
    FLOAT fDist=(plFlameSource.pl_PositionVector-plEnemy.pl_PositionVector).Length();
    plEnemy.AbsoluteToRelative(plFlameSource);
    DirectionVectorToAngles(FLOAT3D(plEnemy.pl_PositionVector(1),0.0f,plEnemy.pl_PositionVector(3)),plEnemy.pl_OrientationAngle);
    plEnemy.pl_OrientationAngle(2)=90.0f-ACos((plEnemy.pl_PositionVector(2)-1.0f)/fDist);
    if(plEnemy.pl_OrientationAngle(2)>70.0f||
    plEnemy.pl_OrientationAngle(2)<-70.0f||
    plEnemy.pl_OrientationAngle(1)>70.0f||
    plEnemy.pl_OrientationAngle(1)<-70.0f) {
     m_soFire1.Stop();
     PlaySound(m_soFire2, SOUND_FIREBUG_STOP, SOF_3D);  
     return EReturn();
    }
   }
   CPlacement3D plFlamePlacement=CPlacement3D(FIREPOS_FIREBUG,plEnemy.pl_OrientationAngle);
   plFlamePlacement.RelativeToAbsolute(plFlameSource);
   plFlameSource=plFlamePlacement;
   CEntityPointer penFlame = CreateEntity(plFlameSource, CLASS_PROJECTILE);
         ELaunchProjectile eLaunch;
   eLaunch.penLauncher = this;
   eLaunch.prtType = PRT_FLAME_GRUNT;
   penFlame->Initialize(eLaunch);
   if (m_penFlame!=NULL && !(m_penFlame->GetFlags()&ENF_DELETED)) {
    ((CProjectile&)*m_penFlame).m_penParticles = penFlame;
   }
   ((CProjectile&)*penFlame).m_penParticles = this;
   m_penFlame = penFlame;
   autowait(0.1f);
   m_iFlameTime++;
  }
  m_soFire1.Stop();
  PlaySound(m_soFire2, SOUND_FIREBUG_STOP, SOF_3D);
  return EReturn();
}


Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
XFighter Понедельник, 31.12.2012, 09:44 | Сообщение # 1725


Сообщений: 20
Награды: 0
Замечания: 20%
 
SLAwww, okay попробую, кстати друг это я :D
-------------------
Спасибо помогло, стреляет огнем, все нормально.
Сообщение отредактировал XFighter - Понедельник, 31.12.2012, 09:54


Heming_Hitrowski Суббота, 05.01.2013, 14:06 | Сообщение # 1726


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
Вопрос такой:
После смерти игрока мне нужно проверить наличие у всех игроков определенной переменной.
Я пробовал делать это так. В Death(EDeath eDeath) я поместил следующее
// autoreset game if all players are humans/zombies
for(int i = 0; i < CEntity::GetMaxPlayers(); i++) {
CPlayer* penPlayer = (CPlayer*)CEntity::GetPlayerEntity(i);
if (m_bIAmZombie==TRUE) {
penPlayer->SendEvent(EGameReset());
CPrintF(TRANS("ZOMBIES WIN"));
} else {
CPrintF(TRANS("HUMANS WIN"));
penPlayer->SendEvent(EGameReset());
}
}

Тем не менее, игра почему-то вырубилась.

Также такой вопрос: У меня есть определенная энтити, которая совершает действие (вызывает эвент в игроке). Как можно можно ее активировать кодом, с указанием нужного мне события? (она может как активировать эвент, так и изменить переменную в игроке). И еще - как можно ее активировать после 10 секунд после старта игры? Учтите, триггер с автостартом не прокатит, нужно именно кодом.
Был бы очень признателен, если поможете.
Сообщение отредактировал Heming_Hitrowski - Суббота, 05.01.2013, 14:10


SLAwww Суббота, 05.01.2013, 16:40 | Сообщение # 1727


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
CEntity::GetMaxPlayers() - тебе нужно вызывать просто GetMaxPlayers(). И проверяй penPlayer перед тем, как обращаешься к нему через указатель; ты итерируешь от 0 до максимального числа игроков, а их может быть меньше максимального, поэтому penPlayer может быть NULL.
Второй вопрос не понял. Вызывает ивент? В игроке? Может, она посылает ивент игроку? Активировать - в смысле, отправить EActivate? И как вообще можно "активировать ивент"? Если нужно послать ивент, используй penPointerToSomeEntity->SendEvent(eSomeEventObject). А чтобы что-то сработало через определённое время, можно использовать wait с задержкой:
Код
wait(10.0f) {
on (ETimer) : { stop;   }
otherwise() : { resume; }
}
SomeFunction(); // Будет вызвана через 10 секунд

Или (ещё проще и правильнее) - autowait:
Код
autowait(10.0f);
SomeFunction();

wait и autowait работают только внутри процедур. autowait не работает внутри wait.


Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
Heming_Hitrowski Суббота, 05.01.2013, 16:47 | Сообщение # 1728


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
SLAwww, Спасибо, попробую

seriously_petr Четверг, 10.01.2013, 19:07 | Сообщение # 1729


Сообщений: 446
Награды: 4
Замечания: 0%
 
Код
--------------------Configuration: EntitiesMP - Win32 Release--------------------
Compiling...
Command line warning D4002 : ignoring unknown option '/Ot'
Command line warning D4002 : ignoring unknown option '/Og'
Command line warning D4002 : ignoring unknown option '/Oi'
Command line warning D4002 : ignoring unknown option '/Oy-'
StdH.cpp
E:\Mymod\Sources\EntitiesMP\StdH\StdH.h(1) : fatal error C1083: Cannot open include file: 'Engine\Engine.h': No such file or directory
Error executing cl.exe.

EntitiesMP.dll - 1 error(s), 4 warning(s)


Нивкакую не хочет компилироваться, даже на чистом сдк. Пути прописывал, Dependencies выставлял. Всё как надо, а всё равно не работает.

Почему-то не хочет находить инклуды, хотя всё лежит по папкам как надо.


SLAwww Четверг, 10.01.2013, 20:01 | Сообщение # 1730


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Ты это в Visual C++ 6.0 компилируешь? А не пытался перед этим открывать проекты СДК в более новой версии? Выглядит так, словно пытался. Так или иначе, компилятор говорит, что у тебя в папке с проектом нет папки Engine, а в ней нет файла Engine.h.

Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
seriously_petr Четверг, 10.01.2013, 20:35 | Сообщение # 1731


Сообщений: 446
Награды: 4
Замечания: 0%
 
Цитата
Ты это в Visual C++ 6.0 компилируешь


А похоже чтоли, что я компилирую это в Turbo Pascal или в Eclipse?

Конечно же у меня студия 6.0, причём та же, что я использовал на старом компе, тогда всё работало. Установка на винчестере я специально сохранял.
Сообщение отредактировал seriously_petr - Четверг, 10.01.2013, 20:53


SLAwww Четверг, 10.01.2013, 21:35 | Сообщение # 1732


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Нет, похоже, что ты компилируешь в VC6.0 то, что перед этим было открыто в чём-то другом. Убедись, что Engine\Engine.h существует в правильном месте.

Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
seriously_petr Четверг, 10.01.2013, 21:57 | Сообщение # 1733


Сообщений: 446
Награды: 4
Замечания: 0%
 
Цитата (SLAwww)
было открыто в чём-то другом

В чём это могло быть открыто, если я скачал чистый SDK c sszone?

Файл Engine.h лежит там, где нужно (E:\RFmod\Sources\Engine\Engine.h).


SeriousAlexej Пятница, 11.01.2013, 01:16 | Сообщение # 1734


Serious Editor
Сообщений: 1245
Награды: 52
Замечания: 0%
 
Цитата (seriously_petr)
Файл Engine.h лежит там, где нужно (E:\RFmod\Sources\Engine\Engine.h).

Цитата (seriously_petr)
E:\Mymod\Sources\EntitiesMP\StdH\StdH.h

Путь неправильный :p


seriously_petr Пятница, 11.01.2013, 16:04 | Сообщение # 1735


Сообщений: 446
Награды: 4
Замечания: 0%
 
SeriousAlexej, Исправил, но та же ошибка.

SLAwww Пятница, 11.01.2013, 21:34 | Сообщение # 1736


Рряа? ^..^
Сообщений: 2398
Награды: 27
Замечания: 0%
 
Значит, ты не исправил. ) Помести файл (а лучше - всю папку Engine) туда, где её хочет видеть компилятор. Затем, первым делом, откомпилируй (отдельно от всего остального) StdH.cpp.

Where did all the dragons go?
We searched in the hills and we searched down the canyons,
we even scanned the depths of the caves with our armour, swords and lanterns.
Oh, if only had we seen him lurch, from his glorious skull covered perch.

CRACK went his claws and SMACK swipped the tail,
a ROAR of might, one big BITE.

and so ended our search.
seriously_petr Суббота, 12.01.2013, 12:37 | Сообщение # 1737


Сообщений: 446
Награды: 4
Замечания: 0%
 
SLAwww, Мне что, скринить все папки и настройки, чтобы показать, то, что всё в порядке? :(

Heming_Hitrowski Суббота, 12.01.2013, 13:22 | Сообщение # 1738


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
seriously_petr, а ты перепроверь еще раз пять. Иногда это помогает.

Denil Суббота, 12.01.2013, 19:50 | Сообщение # 1739


Сообщений: 113
Награды: 0
Замечания: 0%
 
кто нибуть скажите на чем держется ss1 на c++ или C#








Heming_Hitrowski Суббота, 12.01.2013, 20:27 | Сообщение # 1740


Double Jumper
Сообщений: 883
Награды: 32
Замечания: 0%
 
BD19071997, С++

Форум » Serious Sam » Серьёзное редактирование » Помощь по SDK для Serious Sam 1.05/1.07 (Вопросы по комплекту средств разработки для Serious Sam 1.)
Поиск:

Статистика


Кто сегодня был