Меню сайта
HardLife addon
Статистика
Вход

Последнее в блоге
[02.10.2015]
О релизе в steam (14)
[17.06.2015]
Как всё начиналось (3)
Последние картинки
Воскресенье, 28.04.2024, 22:31
Приветствую Вас Гость

Квестинг - Форум

[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 3
  • 1
  • 2
  • 3
  • »
Форум » Модификации » Наука модификации » Квестинг (вопросы.)
Квестинг
SpyДата: Понедельник, 03.01.2011, 16:14 | Сообщение # 1
Майор
Группа: Пользователи
Сообщений: 82
Репутация: 8
Статус: Offline
Знаю, что причин может быть море, но всё же понадеюсь на ваш опыт.

Итак есть квест, он компилировался 0 ошибок, 0 предупреждений. В IDE отлично работал, и так и этак погонял.

Добавил файлы мода в директорию Hardlife/Quests(скомпилированный квест). Прописал в файлике инклюд на него. Работал естественно с выложенными исходниками от 1.10. Сам квест писался практически с 0.
При попытке загрузки игры при прописанном инклюде квеста, игра крашит.

В чём может быть проблема.

 
DeadheadДата: Понедельник, 03.01.2011, 19:17 | Сообщение # 2
Генерал-лейтенант
Группа: Администраторы
Сообщений: 460
Репутация: 66
Статус: Offline
лог? инклюдится вместе с ХЛА? если да, то не стОит
 
SpyДата: Вторник, 04.01.2011, 07:34 | Сообщение # 3
Майор
Группа: Пользователи
Сообщений: 82
Репутация: 8
Статус: Offline
Почему не стоит? в том то и задумка, что бы добавить квест
в любом случае вот лог

 
DeadheadДата: Вторник, 04.01.2011, 11:24 | Сообщение # 4
Генерал-лейтенант
Группа: Администраторы
Сообщений: 460
Репутация: 66
Статус: Offline
ааа, ну так, пробуй новую игру, с загрузки ты всеравно играть не сможешь, даже если стартанет. при таком способе подключения "на лету" в игре пропадают случайки.
 
DancerДата: Четверг, 06.01.2011, 17:08 | Сообщение # 5
Генерал-лейтенант
Группа: Администраторы
Сообщений: 543
Репутация: 144
Статус: Offline
Quote (Spy)
При попытке загрузки игры при прописанном инклюде квеста, игра крашит.
Если в эмуляторе всё работает - проверяйте какие файлы скопировали в игру и как прописали.
Должны быть:
cht
gen
pht
rht

и возможно rep
 
VorotДата: Воскресенье, 13.03.2011, 16:29 | Сообщение # 6
Поручик
Группа: Модераторы
Сообщений: 2806
Репутация: 112
Статус: Offline
1. Как мне узнать лежит ли сумка холодильник в машине?

phrase PHasFoodBagITCar()
GetCarItemCount(Food_bag, i)
if (i >=1)
return Yes
else
return No
end if
end phrase

2. Как мне узнать какой игровой день сейчас или сколько прошло с момента получения квеста?

3. главный вопрос как идентифицировать ГГ, искал-искал, так и не нашел... есть какая нибудь функция возвращающая ГГ1=камерон, ГГ2=Иванов и т.п.? Пока только удается троих по национальности вычислять...


"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)

Сообщение отредактировал Vorot - Воскресенье, 13.03.2011, 16:29
 
popandopaloДата: Понедельник, 14.03.2011, 13:35 | Сообщение # 7
Полковник
Группа: Пользователи
Сообщений: 228
Репутация: 7
Статус: Offline
На время видел такое:
GetMinutesTo (int H, int M)
Выдает кол-во минут от текущего времени, до указанного.

Описание, скорее всего, некорректное, потому что два входных параметра у функции указано, а зачем два, если от текущего, а оно само должно браться, без ввода? Возможно, от одного момента, до другого, только нужно разобраться, в каком виде должны представляться входные данные.

За ГГ еще есть функция, возвращающая пол, и еще одна, которую теоретически можно попытаться использовать для идентификации ГГ:

GetPlayerTalkerID ()
Кто говорит от имени игрока
Параметры:нет
Возвращаемое значение: ID наемника, который говорит

 
VorotДата: Понедельник, 14.03.2011, 13:54 | Сообщение # 8
Поручик
Группа: Модераторы
Сообщений: 2806
Репутация: 112
Статус: Offline
Quote (popandopalo)
потому что два входных параметра

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

про пол спасибо - использовал, но не думал для идентификации ГГ, тоже уже что-то... где-то видел файл со списком национальностей, сейчас найти не могу.

GetPlayerTalkID() - дает локальный ID... (((


"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)
 
popandopaloДата: Понедельник, 14.03.2011, 14:44 | Сообщение # 9
Полковник
Группа: Пользователи
Сообщений: 228
Репутация: 7
Статус: Offline
Quote (Vorot)
два входных параметра - часы и минуты,

Блин, это я конкретно тупанул:)
 
VorotДата: Вторник, 29.03.2011, 12:54 | Сообщение # 10
Поручик
Группа: Модераторы
Сообщений: 2806
Репутация: 112
Статус: Offline
Quote (Vorot)
2. Как мне узнать какой игровой день сейчас или сколько прошло с момента получения квеста?

GetDateString() - сам спросил и сам ответил...

А.

Quote (Vorot)
где-то видел файл со списком национальностей, сейчас найти не могу.

нашел - ..\\INI\MERCENARIES блин но там только четыре... попробовал свои добавить и проэкспериментировать... в логе пишет что ошибка, хотя я и в константах и в файлах прописал....

вопрос про идентификацию ГГ остается открытым...не придумал ничего лучше, чем сверять характеристики, но блин это геморр и от версии к версии может меняться...

Б.
Еще не могу прикрутить квест к Марии Фернандес... вроде бы везде у меня прописана, а ругается как на Undeclared Identifier...

В.
Кто знает, кидает ли движок или квестовая система и как точно пишутся события:
1. Смена CGL
2. Use item
3. Ранения и прочее...
Перечитал мод-кит, там вообще событий мало... посмотрелв симуляторе, тоже не нашел...(((


"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)

Сообщение отредактировал Vorot - Вторник, 29.03.2011, 12:57
 
R@SДата: Вторник, 29.03.2011, 15:57 | Сообщение # 11
Лейтенант
Группа: Пользователи
Сообщений: 54
Репутация: 17
Статус: Offline
Hope I'm not interrupting wink

Change CGL:
if (CurrentGameLevel<=5)//To make sure your CGL doesn't go down
StratAI.SetCurrentGameLevel(6)
end if

Use Item:
def object TestObject
begin

phrase Test()
if (EventParmStr==Test_Item)
//Do what you want the item to do
end if
end phrase

INITIAL
on event "USE Item" callm TestObject.Test() ALWAYS
END INITIAL
end

NOTE:Don't forget to add the item to the HLA.XML file as well

To check and see if player is hit during combat:
def object TestHealth
begin

Attribute TMPHealth

phrase Test()//Checks health at battle start
TestHealth.TMPHealth = call GetAttribute(Player.LocalID, skHP)
this.SetLookupEvent()
end phrase

phrase SetLookupEvent()
local CheckHealth = call GetAttribute(Player.LocalID, skHP)
if(CheckHealth<TestHealth.TMPHealth)
//Do what you want to do when your guy gets hit
else
on event TIMER1+3 callm this.SetLookupEvent()
end if
end phrase

INITIAL
on event "Battle start" callm TestHealth.Test() ALWAYS
END INITIAL
end
Can be used on the mercs in your team as well, but that would require an ID check.

Сообщение отредактировал R@S - Вторник, 29.03.2011, 15:59
 
VorotДата: Вторник, 29.03.2011, 16:58 | Сообщение # 12
Поручик
Группа: Модераторы
Сообщений: 2806
Репутация: 112
Статус: Offline
2 R@S
Sorry for bad english ))) Thanks a lot for Your help. For example, We has: "sector "+str(Campesino.Name)+" loaded", "battle start", "Finish Base00Secretfile" etc.

My question is: Have We events -
1. Cgl changed
2. Player takes light wound
???

3. Use item? (yes We have)
"Use item ItemName"???
"MercName Use item ItemName"???

I asked about the precise transcription of this events.

The main issue:
How to determine what the protagonist is chosen player?

We can determine main character: Ivanov, Kurt, Cameron, Lambert by nationality. What about Kim, Gabriel, Cristine, Sanjay?


"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)

Сообщение отредактировал Vorot - Вторник, 29.03.2011, 17:10
 
R@SДата: Вторник, 29.03.2011, 19:55 | Сообщение # 13
Лейтенант
Группа: Пользователи
Сообщений: 54
Репутация: 17
Статус: Offline
Create a new event that is thrown when CGL increases by making a replace function, the you can do the On Event "LevelUp" callm blabla:

replace StratAI.ShiftCGL by
phrase ShiftCGL_Mod()

this.KillsOnThisGameLevel++

if (this.KillsOnThisGameLevel>=GLChangeCount[CurrentGameLevel] AND (not CurrentGameLevel in [7, 9, 15, 16]))
this.SetCurrentGameLevel(CurrentGameLevel+1)
throw LevelUp //Now you have created an event that is thrown when CGL increases called "LevelUp"
end if
end phrase

To check and see if player is slightly hit during combat:

def object TestHealth
begin

Attribute TMPHealth

phrase Test()//Checks player health at battle start
TestHealth.TMPHealth = call GetAttribute(Player.LocalID, skHP)
this.SetLookupEvent()
end phrase

phrase SetLookupEvent()
local CheckHealth = call GetAttribute(Player.LocalID, skHP)
local Difference = TestHealth.TMPHealth-=CheckHealth
if(Difference<6)//If wound is less than 5HP
//Do what you want to do when your guy gets hit
TestHealth.TMPHealth= CheckHealth//So the next time a light wound happens it will register here again
else
on event TIMER1+3 callm this.SetLookupEvent()
end if
end phrase

INITIAL
on event "Battle start" callm TestHealth.Test() ALWAYS
END INITIAL
end

To make the item do something in the code, first make it a constant
def string const Test_Item = "ItemName of your item"
This part should be outside any object or room.

Then comes the tricky part, seeing which character uses the item.
I haven't tested this yet, I'm still at work, but will check it when I get home tonight.

First we need to find out what character is used, I would check the player.ini file to get that info:
def object vhp
begin

String Attribute file = "error"

phrase InitValueHandler(String obj)

vhp.file = obj

end phrase

phrase pt(String line)
local string handle
local string temp

handle = call StartParsing("ActorsINI\"+str(vhp.file)+".ini")

if (call SkipIdentsUntil(handle, line, Yes)==Yes)
temp = call ReadString(handle)
else
temp = 0-1
end if

call StopParsing(handle)

return temp

end phrase

end

Then we can see who uses the item in the other phrase by calling the vhp function and get the string from the ACTOR entry.
def object TestObject
begin

phrase Test()
callm vhp.InitValueHandler("Player")

if (EventParmStr==Test_Item)
if(callm vhp.pt("ACTOR")==Kim)//Maybe this should be "Kim" or whatever the Player.ini files says the model's AZP file
//Do what you want the item to do when Kim uses it
else
if(callm vhp.pt("ACTOR")==Gabriel)
//Do what you want the item to do When Gabriel uses it
else
if(callm vhp.pt("ACTOR")==Ivanov)
//Do what you want the item to do When Ivanov uses it
else
if(callm vhp.pt("ACTOR")==Kurt)
//Do what you want the item to do When Kurt uses it
else
if(callm vhp.pt("ACTOR")==Cameron)
//Do what you want the item to do When Cameron uses it
else
if(callm vhp.pt("ACTOR")==Lambert)
//Do what you want the item to do When Lambert uses it
else
if(callm vhp.pt("ACTOR")==Christine)
//Do what you want the item to do When Christine uses it
else
if(callm vhp.pt("ACTOR")==Sanjay)
//Do what you want the item to do When Sanjay uses it
end if
end if
end if
end if
end if
end if
end if
end if
end if
end phrase

INITIAL
on event "USE Item" callm TestObject.Test() ALWAYS
END INITIAL
end

Сообщение отредактировал R@S - Вторник, 29.03.2011, 19:59
 
VorotДата: Вторник, 29.03.2011, 22:16 | Сообщение # 14
Поручик
Группа: Модераторы
Сообщений: 2806
Репутация: 112
Статус: Offline
2 R@S
OHH! You Are my HERO of the Year! Thank You very much! I' was waiting for this help for a several weeks.
v
I'll try to use it tonight. I put an object vhp in QuestRoom right?

One more question:
I've an idea for the micro-mod "Heroes do not die". After the death of the hero, the game does not end. The hero comes to life in hospital after a long time. Job failed, the mercenaries fled. He must have a large sum for the treatment. I tried to replace DeathOfMainHero() without result... can You have any advice?


"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)

Сообщение отредактировал Vorot - Вторник, 29.03.2011, 22:28
 
R@SДата: Среда, 30.03.2011, 00:10 | Сообщение # 15
Лейтенант
Группа: Пользователи
Сообщений: 54
Репутация: 17
Статус: Offline
I have tested this and it works biggrin
Just put this in your mod and compile it, then right click on the morphine item and your player says his name depending on what character you have chosen.

Put these outside your quest room:

def string const Test_Item = "morphine"

def object vhp
begin

String Attribute file = "error"

phrase InitValueHandler(String obj)

vhp.file = obj

end phrase

phrase pt(String line)
local string handle
local string temp

handle = call StartParsing("ActorsINI\"+str(vhp.file)+".ini")

if (call SkipIdentsUntil(handle, line, Yes)==Yes)
temp = call ReadString(handle)
else
temp = 0-1
end if

call StopParsing(handle)

return temp

end phrase

end

This you can put inside your quest room if you like, but if you do rember to put the INITIAL part there as well.

def object TestObject
begin

phrase Test()
callm vhp.InitValueHandler("Player")

if (EventParmStr==Test_Item)
if(callm vhp.pt("Actor")=="049_Kim")
Player.Say("Kim")//This is just for testing, put your functions or events here
else
if(callm vhp.pt("Actor")=="285_jaguar")
Player.Say("Gabriel")
else
if(callm vhp.pt("Actor")=="046_AlekseyIvanov")
Player.Say("Ivanov")
else
if(callm vhp.pt("Actor")=="047_Kurt")
Player.Say("Kurt")
else
if(callm vhp.pt("Actor")=="045_Cameron")
Player.Say("Cameron")
else
if(callm vhp.pt("Actor")=="048_Lambert")
Player.Say("Lambert")
else
if(callm vhp.pt("Actor")=="286_hope")
Player.Say("Christine")
else
if(callm vhp.pt("Actor")=="050_Babu")
Player.Say("Sanjay")
end if
end if
end if
end if
end if
end if
end if
end if
end if
end phrase

INITIAL
on event "USE Item" callm TestObject.Test() ALWAYS
END INITIAL
end

And you should add this to the HLA.XML as well:

<UseString value="Check test">
<item>morphine</item>
</UseString>

I have used the morphine as an example since both the Russian and English version, and our mods, has this item. Just replace it with whatever item you want.

I will have to check the HeroDeath thing, I have no clue right now. Maybe try to replace the OnKilled() phrase instead? Or maybe the Player.Resurrect() might work. I'll do some testing and will get back to you, if you tell me exactly what you want to happen I can be more specific in my response

 
Форум » Модификации » Наука модификации » Квестинг (вопросы.)
  • Страница 1 из 3
  • 1
  • 2
  • 3
  • »
Поиск: