Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some Coding Questions
Alex Ros Offline
Senior Member

Posts: 447
Threads: 46
Joined: Aug 2012
Reputation: 20
#1
Some Coding Questions

As long as I am not a coder I have to ask a few questions. I do understand theoretically what is coding and I can read and understand functions and what do they do exactly. But I can't script anything new by myself. So...

1. There's an option to turn off all sanity visual effects. I mean the main menu Options. Is it possible to script FC in such a way so all sanity effects are always turned off? And is it possible to make such a custom main menu where those sanity checkers would be hidden so the player could not even see them?

2. Is it possible to turn off inventory? I mean completely, no inventory at all, no button for opening it.

3. Is it possible to turn off mementos and notes sections, but leave only diary alone?
(This post was last modified: 07-09-2013, 05:15 PM by Alex Ros.)
07-09-2013, 05:14 PM
Website Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#2
RE: Some Coding Questions

1) SetSanityDrainDisabled(bool abX);

2) SetInventoryDisabled(bool abX);

3) No, if you disable inventory you disable notes, mementos, and diary as well.

If you're making a Full Conversion, I'm sure you can rig up some clever in-game way of simulating a diary, though.

[Image: signature-2.png]
(This post was last modified: 07-09-2013, 05:39 PM by Streetboat.)
07-09-2013, 05:37 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#3
RE: Some Coding Questions

(07-09-2013, 05:37 PM)Streetboat Wrote: 1) SetSanityDrainDisabled(bool abX);

That only disables the drain on your sanity 'points', you still get the visual effects.

Alex, if you're using an FC there are settings in the game.cfg (iirc) that control the visual parts, as far as I know there is no way to do it in the script, but from the config you should be able to set it up so there are no visual effects from standing in darkness - however I'm pretty sure there is no way to get rid of the visual effect from looking at enemies (does that get disabled too when turning it off in Options?). Although you can customise the main menu, I don't think you can change the contents of the Options screen specifically

07-10-2013, 05:21 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Some Coding Questions

3. Is it possible to turn off mementos and notes sections, but leave only diary alone?

---You can try all these things below---
This IS excually possible,
I need to check it.
1 thing i know is JUST,
when you are in the inventory, you see the notebook on the right corner.
replace that in the INVENTORY with BLACKNESS,
So : open up inventory in your mod "must be FC "
go look for the book, open it with for example paint.net and make the book totally black! <- OVERWRITE ORIGINAL!!!
then you wont see the book in inventory.
----------------------------------
Then next thing.
2 - how to remove the part where you toutch it with the mouse :
go to : MENU.cfg and open it look for these :
JournalCenter = "720 472 1"<Like make the JournalCenter like -5000 { maybe you will not see it anymore}
JournalLabelCenter = "720 472 1"
JournalFrameSize = "100 -1"
JournalFrameHPadding = "0 0" PLAY WITH THESE, try get it out of the screen!
JournalFrameVPadding = "10 10"<Like make the frameoffset like -5000 { maybe will nog seen anymore}
JournalFrameOffset = "-5 0 0"
---------
Then for the last question..
you might remove the M , and N from the base_english.cfg
try it never done it, might crash teh game but worth a try!!!
ALSO REMOVE THESE LINES TO BE 100% SURE:
<Entry Name="Journal">Guide</Entry>
<Entry Name="JournalDesc">Contains notes and valuable information. Click to open.</Entry>
--- AND THIS ---
<CATEGORY Name="Journal">
<Entry Name="Notes">LETTERS</Entry>
<Entry Name="Diaries">LOG</Entry>
<Entry Name="Quest Log">TASKS</Entry>
<Entry Name="Back">Back</Entry>
<Entry Name="MainBack">BACK</Entry>
<Entry Name="NotesEmpty">No letters are available!</Entry>
<Entry Name="DiariesEmpty">No logs are available!</Entry>
<Entry Name="QuestsEmpty">No tasks are available!</Entry>
</CATEGORY>

AND this maybe :
<Entry Name="M">M</Entry>
<Entry Name="N">N</Entry>
----------------------
Just try,
Don't even know WHY you want to change it, but there are some solutions but they are difficult!!!
_*_*_*
MODDING = TRYING & DO STUFF WRONG, ---> MAKE BACKUPS!!!
(This post was last modified: 07-10-2013, 07:04 PM by DnALANGE.)
07-10-2013, 07:00 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: Some Coding Questions

One thing I do for some occasions is putting a un-pickable note and putting a Sign Area. It's ok for some areas, just to say things like: "Beware! The modder hasn't added a ground yet."

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-10-2013, 07:11 PM
Find
Alex Ros Offline
Senior Member

Posts: 447
Threads: 46
Joined: Aug 2012
Reputation: 20
#6
RE: Some Coding Questions

Thank you very much Streetboat, Adrianis, DnAlange and dear mr. Chaser for support, understanding and help. And it did help a lot, really. When I'll got maps themselves ready I will ask a bit more questions, a bit more presize questions with screenshots. Anyway, all I can peek in other stories and original game I do peek, so I ask only when I am really stuck. I am not a lazy one shithole, do not worry about that, I won't be nasty ))))))



New question.

Is it possible to script areas so when a player just looks at them the voiced over monologue would be pronounced aloud? I mean free-roaming and free-looking. For example, if a player by himself will look at the window (just for example) and at the moment he will point his eyes at the window a voiced-over monologue would be triggered? Is that possible at all? Without touching anything, just by looking at some particular area.

I presume it's not possible. I suppose it's not possible with just a player looking at something. I suppose player should enter the area and that would trigger voice-script, no other way... or I am wrong and looking at the area is also could trigger scripted voice-over?
(This post was last modified: 07-15-2013, 02:27 PM by Alex Ros.)
07-10-2013, 07:53 PM
Website Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#7
RE: Some Coding Questions

You're actually in luck!

void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);



Quote:Calls a function when the player looks at a certain entity.

Callback syntax: void MyFunc(string &in asEntity, int alState)

alState: 1 = looking, -1 = not looking

asName - internal name

asCallback - function to call

abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity
Many people have already used this to produce certain neat effects on their own mods.

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 07-15-2013, 02:20 PM by Kreekakon.)
07-15-2013, 02:20 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#8
RE: Some Coding Questions

(07-15-2013, 02:17 PM)Alex Ros Wrote: New question.

Is it possible to script areas so when a player just looks at them the voiced over monologue would be pronounced aloud? I mean free-roaming and free-looking. For example, if a player by himself will look at the window (just for example) and at the moment he will point his eyes at the window a voiced-over monologue would be triggered? Is that possible at all? Without touching anything, just by looking at some particular area.

I presume it's not possible. I suppose it's not possible with just a player looking at something. I suppose player should enter the area and that would trigger voice-script, no other way... or I am wrong and looking at the area is also could trigger scripted voice-over?

Yeh it's totally possible.

http://wiki.frictionalgames.com/hpl2/amn...s#entities

5th on the list for Entity related functions is SetEntityPlayerLookAtCallback, you can use a script area in place of the entity name. Then in the function that the LookAtCallback calls, you can use PlayMusic or whichever function suits for the sound files you have

Here's some sample code

void OnStart()
{
    SetEntityPlayerLookAtCallback("ScriptArea", "LookedAtWindow", true);
}

void LookedAtWindow(string &in strEntity, int inState)
{
    PlayMusic("Talking.ogg", false, 10, 0, 1, false);
}

I'm only using the PlayMusic function because it's the simplest, you'll only need the sound file in .ogg to use it. Check out the details for the parameters to give to PlayMusic so that it suits you're needs.

With the LookAtCallback, once you've implemeneted that test it to make sure it doesn't trigger through a wall, I've had issues with that before. You could potentially make the window into an Entity just for the purposes of using that function in case you have problems with the script area.


EDIT: ninja'd! scum! oh well. In addition to all that Alex, you may find it useful to take the time to read through the whole list of functions on the engine script page. You don't need to understand them all, or even know how to use them instantly, but it's really helpful just from the name & descriptions to know what is technically possible given the options there. Many people underestimate how important it is just to have a basic overview of everything first, before you get into specifics

(This post was last modified: 07-15-2013, 02:29 PM by Adrianis.)
07-15-2013, 02:26 PM
Find
Alex Ros Offline
Senior Member

Posts: 447
Threads: 46
Joined: Aug 2012
Reputation: 20
#9
RE: Some Coding Questions

That's cool... no inventory is possible, no sanity loss ann no visual effects of sanity loss while in the dark areas is also possible. And finally triggering voiced-over monologues while a player just looking at the particular objects. That's just really cool! Thank you Kreekakon and Adrianis!!!

P.S. I hope custom models and textures would be nice help-in-back when I would finish my tiny mod... or discontinue it.
(This post was last modified: 07-15-2013, 02:33 PM by Alex Ros.)
07-15-2013, 02:26 PM
Website Find




Users browsing this thread: 3 Guest(s)