Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » lua script editing questions
lua script editing questions[message #334507] Thu, 24 July 2014 01:17 Go to next message
Kovacs2014
Messages:8
Registered:July 2014
Location: Germany
Hi everybody,
I figured out how to implement new Emails via the .lua scripts. Because this was quite easy I thought it might be nice to finally have some additional quests available.

To keep it "simple" in the beginning I would like to activate two new quest directly after the game start like the "deliver the letter quest" without hitting any additional buttons or have to activate the briefing room feature. This two quests could be linked to corresponding emails if this makes it easier ...
I added new lines to the quests.edt to have some entries for the history and also new entries in the quest.lua (nQuests=Quest_26 = 26) and tried to start it in the GameInit.lua with the command StartQuest(26) after the function initnewgame()
It is not working because I think I am still missing the connection between the internal quest id and some other files ... or do I need this internal quest designation at all? Does someone knows more about this topic and can give me a hint?

Since this is my first post here on BP since ages, a bit about myself:
I am modding JA2 since the beginning (well somewhere around the end of 98 / beginning of 99 if I remember correctly ... duh for ages ...) quite continiusly mainly items, maps, faces, tilesets. I also made some maps for several released mods. In the past and with close friends still I am commonly known as Cain. I am now running a total conversion based on 1.13 with the 7307 exe. Unfortunately I can not code and I just started with the lua scripts ...

All the best from Germany,
Kovacs

Re: lua script editing questions[message #334509] Thu, 24 July 2014 01:28 Go to previous messageGo to next message
Tox

 
Messages:249
Registered:February 2000
Location: www.webcodesign.de
welcome aboard, finally managed to get you to register Very Happy

it might be helpful if you would attach links to your files or post the sources. not that I know anything about LUA, but others might.

JA2STI Creator
Re: lua script editing questions[message #334511] Thu, 24 July 2014 03:53 Go to previous messageGo to next message
Kovacs2014
Messages:8
Registered:July 2014
Location: Germany
Thanks Tox! Yes thanks to you I finally registered again.

Somehow I figured a bit more out about starting quests with scripts direcly at the start of a new game.

The goal in my case / this example: start quest 26 "optain package" at the gamestart like the quest "deliver letter to miguel"
What I have done (and after some missed syntax and 20 restarts finaly worked ... at least so far ...):

1. edit quest.edt in directory my mod\binarydata\ (I used the JA2 EDiTor from Linx) and add in line 56 the text optain package

2. edit GameInit.lua in directory my mod\scripts\ (I used Programmer's Notepad the win Editor should work also) search for function InitNewGame() and add before the end command for this function the new line
StartQuest(26, 9, 1)

Start a new game with your mod and you should now have in the history the following three entries:
day 0, location n/a, event accepted assignment ... - finished
day 1, location n/a, event deliver letter ... - active
day 1, location A9: Omerta, event optain package -active

I didn't find the syntax for the location "n/a" so far maybe someone has an idear or a documentation?
Ehm it's a wip so don't blame me if you brake something in your mod and remember always backup before you change something Wink

greetz
Re: lua script editing questions[message #334519] Thu, 24 July 2014 11:44 Go to previous messageGo to next message
Realist

 
Messages:27
Registered:September 2005
Location: Duesseldorf, Germany
Quote:
I didn't find the syntax for the location "n/a" so far maybe someone has an idear or a documentation?

Passing -1 for sectorX and sectorY might work, i.e. StartQuest(26, -1, -1)
Re: lua script editing questions[message #334522] Thu, 24 July 2014 12:23 Go to previous message
Kovacs2014
Messages:8
Registered:July 2014
Location: Germany
Realist
Passing -1 for sectorX and sectorY might work, i.e. StartQuest(26, -1, -1)


yes, that worked for a location "n/a"! Thank you!
Previous Topic: Modding Bobby Rays Inventory
Next Topic: Changing IMP Voices?
Goto Forum:
  


Current Time: Sun Apr 23 14:57:39 EEST 2017

Total time taken to generate the page: 0.00778 seconds