Scripts / KillQuests

Author
Message
benjiboy
7
Years of Service
User Offline
Joined: 24th Mar 2017
Location: In the depths of rural Norfolk
Posted: 15th Oct 2019 18:00
I have just been watching Ravey's great tutorial on kill quests and picked up his lua script. Being an old-fashioned, lazy programmer, I intend making a little standalone app, (some people may ask why, and my reply is 'I'm lazy') wherein the none lua scripter can input the various bits of data that make up the quest and out the end will be squirted a killquest script that the use can then attach to his own version of Ravey's green barrel.
But.
It would be very,very good if I could validate all the input entity id's against the fpm, so as to avoid a simple typing error causing an invalid entity error.
Can I beg one of you deep delving developer types to share with me where I should look, and what for? It would save me a lot of time and aged grey matter overheating if I don't have to reverse engineer it all. . .
You can't teach an old dog.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Oct 2019 20:18
How is your application going to read an fpm file? It is a compressed archive with a password.

Actually scripts should never explicitly use entity IDs, instead you should write them to determine them at runtime.

Been there, done that, got all the T-Shirts!
PM
benjiboy
7
Years of Service
User Offline
Joined: 24th Mar 2017
Location: In the depths of rural Norfolk
Posted: 16th Oct 2019 04:28 Edited at: 16th Oct 2019 05:14
I reviewd the tutorial again and there's a section where Ravey explains the need for a 1 frame delay before building the quests - to allow for entities to be enumerated.
That makes it sound like entity id's are not recorded in a table in the fpm which seems odd to me. The info of type, co-ordinates, roatation scale etc. etc. must all be written in there and the entity id would surely just be a position within the table.

What is compressed AmenMoses, can be decompressed and recompressed n'est pas?

With regard to figuring entity numbers at run time - as a principal it's fine, but it wouldn't work in this situation because for a given quest the creator wants (a) specific enemy(ies) to be the quest target. If there are 10 ogres dotted around the map and it's only the one stood just 20 yards away that must be killed to complete the quest then if you don't specify the entity number you'd need a facility built into the editor to interactively select the targets at quest definition time. I'll not hold my breath waiting for that facility to become available.
You can't teach an old dog.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Oct 2019 09:23
It's probably because there used to be a bug where the init function wasn't started for all entities before some main functions... Thus if you tried to interact with those entities it would crash GG, it's not an issue anymore.

And yes GG knows the entity numbers before you hit test game, they're the same as you see in the editor so there is likely a log somewhere but amen is right, you should use variables to store them by script using the 'e' that is given by the engine automatically, otherwise any deleted objects can cause the entity numbers to change and will mess up any hard coded values.
You can reference specific entities by name in the editor
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
benjiboy
7
Years of Service
User Offline
Joined: 24th Mar 2017
Location: In the depths of rural Norfolk
Posted: 17th Oct 2019 05:24
That's the point smallg. I'm not referencing them in the editor, I'll be referencing them in a VB program outside of GG to generate a lua script, and wanting to validate their existence in the fpm. Looking at the data I'm guessing the entity number is simply the index for the entity in the file, rather than being assigned.

I haven't tried it yet but yes, I expect later editing of a map which included deleting lower numbered entities than those referenced in the script would lead to problems.

So a better option will be to assign Quest givers and quest targets unique names which I know I can validate against the fpm, but I was wanting to avoid forcing creators to work in particular ways in order to use the app.
Still that'd be a small price to pay for non-scripters to have the ability to build quests without going anywhere near code of any kind.

Some peoples brains simply don't work in code and piddling about in notepad++ or whichever is a real turn-off for them.
You can't teach an old dog.

Login to post a reply

Server time is: 2024-12-22 09:15:26
Your offset time is: 2024-12-22 09:15:26