Scripts / NPC's

Author
Message
Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 10th Mar 2015 15:28
Can i turn only one character mob into a NPC that gives quests by turing one of the already made characters static and add quest log?

If so could it be explained? As well as this, how do you make a quest stick? And reward?
PM
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 10th Mar 2015 18:31
It is possible, however you will need to dive into LUA to make something like that.
Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 10th Mar 2015 18:33 Edited at: 10th Mar 2015 19:25
Yes of course, and that was what i was hoping for.

A nudge in the correct direction.

Nothing like diving in though.

If i drown it is all your fault Avram

FYI: your links are broken. Thought you should know : P
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Mar 2015 19:54
you need to keep it dynamic to use scripts, simply changing the script is enough to stop it attacking you

for the quest take a look here https://forum.game-guru.com/thread/207801?page=5#msg2500378
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 10th Mar 2015 21:12
Yep, there is virtually no script smallg haven't already made.

Thanks for the info, I have fixed the links in my signature (I think).
Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 11th Mar 2015 00:30
Do i put the script after giving the mob an identifier in the map code, or in global?
PM
Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 11th Mar 2015 23:41
My question, which it has been this whole time that i've been trying to test this stuff, is where do i place the code.

Is it to global, is it to map, is it to character data file? Where?

Sorry if i seem testy, it's just that i have asked this 5 times already on different posts and no one will give me an answer
PM
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 12th Mar 2015 02:22
You save the script as npc.lua and assign it to the character. Make sure your functions match your file name, i.e. if it's npc.lua functions must be named npc_init(e) and npc_main(e)

Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 12th Mar 2015 14:32
@Avram

All i needed to know. Thank you so much for the information.

Like i said, trying to get that knowledge this entire time.

Thank you
PM
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 12th Mar 2015 18:07
Well you can assign scripts only to entities, there are no "global" scripts. Do not confuse it with global.lua which is first loaded automatically to bootstrap the GG LUA engine, no scripts should be added to that file (unless you really know what you are doing).

Login to post a reply

Server time is: 2024-12-21 14:35:23
Your offset time is: 2024-12-21 14:35:23