Знаю, что причин может быть море, но всё же понадеюсь на ваш опыт.
Итак есть квест, он компилировался 0 ошибок, 0 предупреждений. В IDE отлично работал, и так и этак погонял.
Добавил файлы мода в директорию Hardlife/Quests(скомпилированный квест). Прописал в файлике инклюд на него. Работал естественно с выложенными исходниками от 1.10. Сам квест писался практически с 0. При попытке загрузки игры при прописанном инклюде квеста, игра крашит.
ааа, ну так, пробуй новую игру, с загрузки ты всеравно играть не сможешь, даже если стартанет. при таком способе подключения "на лету" в игре пропадают случайки.
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
На время видел такое: GetMinutesTo (int H, int M) Выдает кол-во минут от текущего времени, до указанного.
Описание, скорее всего, некорректное, потому что два входных параметра у функции указано, а зачем два, если от текущего, а оно само должно браться, без ввода? Возможно, от одного момента, до другого, только нужно разобраться, в каком виде должны представляться входные данные.
За ГГ еще есть функция, возвращающая пол, и еще одна, которую теоретически можно попытаться использовать для идентификации ГГ:
GetPlayerTalkerID () Кто говорит от имени игрока Параметры:нет Возвращаемое значение: ID наемника, который говорит
два входных параметра - часы и минуты, должно сработать нормально.
про пол спасибо - использовал, но не думал для идентификации ГГ, тоже уже что-то... где-то видел файл со списком национальностей, сейчас найти не могу.
GetPlayerTalkID() - дает локальный ID... (((
"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)
2. Как мне узнать какой игровой день сейчас или сколько прошло с момента получения квеста?
GetDateString() - сам спросил и сам ответил...
А.
Quote (Vorot)
где-то видел файл со списком национальностей, сейчас найти не могу.
нашел - ..\\INI\MERCENARIES блин но там только четыре... попробовал свои добавить и проэкспериментировать... в логе пишет что ошибка, хотя я и в константах и в файлах прописал....
вопрос про идентификацию ГГ остается открытым...не придумал ничего лучше, чем сверять характеристики, но блин это геморр и от версии к версии может меняться...
Б. Еще не могу прикрутить квест к Марии Фернандес... вроде бы везде у меня прописана, а ругается как на Undeclared Identifier...
В. Кто знает, кидает ли движок или квестовая система и как точно пишутся события: 1. Смена CGL 2. Use item 3. Ранения и прочее... Перечитал мод-кит, там вообще событий мало... посмотрелв симуляторе, тоже не нашел...(((
"Они хотели нас похоронить, но не знали, что мы семена" (мексиканская пословица)
Сообщение отредактировал Vorot - Вторник, 29.03.2011, 12:57
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
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
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
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
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.
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
I have tested this and it works 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
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
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