Никак. Настраивай СДК и компилируй свои собственные ДЛЛ. Реальная работа с дизассемблированным кодом гораздо сложнее, чем тихое и спокойное написание классов на С++, так что можешь об этом забыть.
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.
А существует ли у COLT_ATTACHMENT_BULLETS анимация с индексом COLT_ANIM_FIRE1? Про анимированную текстуру - там подход аналогичный, просто используется объект типа CTextureObject, который входит в состав CAttachmentModel или как его там.
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.
По поводу предыдущего бага - точно не знаю, что это может быть. Попробуй по очереди комментировать строки, относящиеся ко второму выстрелу (начиная с конца), пока баг не исчезнет.
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.
В стандарте языка нет разделения на функции и процедуры, это всё - примочки ES-диалекта, поэтому IDE называет их функциями, но всё-же процедуры извне лучше не вызывать, потому что они являются "состояниями", в одном из которых находится объект. Они вызываются, как правило, самим объектом соответствующего класса: в CPlayerWeapons в какой-то точке происходит ожидание ивента (wait), и при получении определённого ивента вызывается процедура. Как-то так:
Code
on (EDestroyGhostBusterRay) : { call DestroyGhostBusterRay() EReturn; resume; }
Вариант полегче - просто оформить этот твой DestroyGhostBusterRay функцией, а не процедурой.
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.
Спасибо SLAwww все работает. (Что бы я без тебя делал.) Вопрос Как при попадании во врага с опр. оружия сделать появление аттачмента у этого оружия. Как добавить аттач. я знаю, а как вызвать эту функцию только при попадении опр. оружия нет.
Всё очень серьёзно. P.S. Не пишите мне на Email, пишите в Л.С.
В функции стрельбы у каждого оружия, стреляющего пулями (FireTommygun, FireDoubleShotgun и т. д.), пропиши проверку m_penRayHit. Если m_penRayHit указывает на врага (m_penRayHit ненулевой и IsDerivedFromClass(m_penRayHit,"Enemy Base") возвращает TRUE), добавляй аттачмент. Можно пойти другим путём - в RecieveDamage у CEnemyBase прописать проверку Inflictor'а - если таковым является игрок, отправить ему ивент или иным образом сообщить о необходимости добавления аттачмента.
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.
Начиная со строки 2089 в PlayerWeapons.es выполняются действия над объектом, который получает повреждения от бензопилы (penClosest). Можешь проверять этот penClosest, и в зависимости от него добавлять или убирать аттачмент.
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.
Конечно, ведь penClosest - локальная переменная метода CutWithChainsaw, а тебе нужно сделать её глобальной.
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.
Как видишь, скорости бега и так рандомизированы, хотя, можно увеличить разброс, сделав, например, не FRnd()*2.0f + 10.0f, а FRnd()*6.0f + 8.0f.
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.
Добавлено (23.12.2012, 19:27) --------------------------------------------- --------------------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-' HUD.cpp E:\Program Files\Croteam\SeriousSam-2\The Second Encounter\Mods\MyMod\Sources\EntitiesMP\Common\HUD.cpp(752) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information Error executing cl.exe.
EntitiesMP.dll - 1 error(s), 4 warning(s) wtf?? что за ошибка, утром её не было.
Неправильно настроен проект и/или сама IDE. Возможно, ты открыл проект не в VC++ 6.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.
SLAwww, я его открывал в vc++6.0, как что буду заново настраивать сдк.
Добавлено (24.12.2012, 09:10) --------------------------------------------- хм, вроде бы всё работает, я просто диск когда вытащил (:E) у меня там сдк, как сразу вирус выдал, который половину файлов сожрал , я в HUD.CPP хотел радар отрегулировать, чтобы он ловил врагов с далекого расстояния, а не с близкого, не получилось ошибку эту выдал.
Добавлено (24.12.2012, 13:09) --------------------------------------------- Помогите, я решил сделать SeriousSpeed для врагов, он что-то не работает. Я прописал в EnemyBase.es вот это, вот код: // SeriousSpeed for enemies void SeriousSpeed(void) { if (!m_bSeriousSpeed)
Во-первых, когда вызывается этот метод? Он должен вызываться уже после того, как в процедуре Main у врага были заданы значения его переменных. Во-вторых, m_fAttackRunSpeed - не единственный параметр, отвечающий за скорость бега, там ещё есть m_fCloseRunSpeed. В третьих, партикли отрисовываются не так - их нужно отрисовывать в AdjustShadingParameters в каждом кадре.
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.
Ситуация. Я хочу сделать так что бы когда работает «Камера» (в смысле ентия) то от при нажатии левой или правой кнопки мыши идут сигналы на триггеры которые указаны в камере. Указатели в камере я сделал на примере триггеров добавив
Код
75 enum EventEType m_eetEvent1 "Event type Tar 01" 'G' = EET_TRIGGER, 76 enum EventEType m_eetEvent2 "Event type Tar 02" 'Z' = EET_TRIGGER,
Теперь нужно (как я думаю) в player.es Нужно добавить типа вот этого
Код
if (ulNewButtons&(PLACT_FIRE|PLACT_USE|PLACT_COMPUTER)) { if (111111111) { CEntity *m_penTar1 = ((CCamera&)*m_penCamera).m_penTar1; // 222222 } }
Но я не знаю 1. Что с чем сравнивать там, где стоят единицы. 2. Правильно составлена строка там, где стоят двойки. 3. Куда этот код вставить (в player.es много чего с камерой а какая верная я незнаю). 4. (Сначала сделал, а потом задумался) ход мыслей вообще верен или я тут всякую чушь написал.
Сообщение отредактировалCAHEK - Среда, 26.12.2012, 11:00
Всё очень серьёзно. P.S. Не пишите мне на Email, пишите в Л.С.
Вообще, не обязательно это делать через игрока. Я об этом уже не раз писал - достаточно в цикле в любой энтити проверять _pShell->GetINDEX("ctl_bMoveForward") (вместо clt_bMoveForward можно любой другой Control-параметр); это выражение вернёт 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.
Запускаю у себя сервер и подключаюсь к нему, повторно запустив Сэма. Выбираю тип связи - старый модем. Проблема в том, что иногда у сервера и у клиента функция GetPlacement() возвращает разные значения с отклонением от 1й тысячной, до 2х целых в одном из параметров... Как с этим бороться? Еще хотел бы узнать разницу между GetPlacement() и GetLerpedPlacement().
Это виртуальный метод 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.
Добавлено (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
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.
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.