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
[Help] Envy the Dead Developemt & Scripting Questions
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#21
RE: [Help] Envy the Dead Developemt & Scripting Questions

1) As far as I understand pickuptinder is the internal name and PickUpTinder is the function to call. But where do you actually specify at which entity the callback will execute?

2) So for music I should probably use PlayMusic and for small sounds PlayGuiSound. Because if I want to play a scared sound (reaction) which is like 2 seconds, noone will even notice the 3D lack.

Edit: At PlayMusic I think it says that only the sound with the highest priority can be heard. What does that mean? Because when I first read it I thought that only one sound can be played at any given time making multiple sound playback not possible, something that I know is not true.

3) Thank you for the info, that thread was indeed helpful. When I'm done with everything I will spend some time improving the performance and I will add all those performance fixes. There's also a small guide at the wiki as far as I recall. But that's for later...
(This post was last modified: 03-16-2013, 03:29 PM by plutomaniac.)
03-16-2013, 03:26 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#22
RE: [Help] Envy the Dead Developemt & Scripting Questions

(03-16-2013, 03:26 PM)plutomaniac Wrote: 1) As far as I understand pickuptinder is the internal name and PickUpTinder is the function to call. But where do you actually specify at which entity the callback will execute?

2) So for music I should probably use PlayMusic and for small sounds PlayGuiSound. Because if I want to play a scared sound (reaction) which is like 2 seconds, noone will even notice the 3D lack.

Edit: At PlayMusic I think it says that only the sound with the highest priority can be heard. What does that mean? Because when I first read it I thought that only one sound can be played at any given time making multiple sound playback not possible, something that I know is not true.

3) Thank you for the info, that thread was indeed helpful. When I'm done with everything I will spend some time improving the performance and I will add all those performance fixes. There's also a small guide at the wiki as far as I recall. But that's for later...

1) asName is the internal name for the item (the name it's called in the level editor). SetEntityPlayerInteractCallback(asName, asCallback, abRemoveOnInteraction);

2) Yes, you should use PlayMusic for music, and for sounds, you should use either PlaySoundAtEntity or PlayGuiSound. If you don't need the sound to be 3d, then use PlayGuiSound. Regarding the priority stuff, only the music with the highest priority will play.
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

You can have multiple sound playing at the same time, but only one music track is allowed to be played.

In Ruins [WIP]
03-16-2013, 06:41 PM
Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#23
RE: [Help] Envy the Dead Developemt & Scripting Questions

Something that also bumps me is that when I use AddUseItemCallback even if I set the boolean to true in the end, the item is not automatically removed and thus I have to use RemoveItem. Is this normal?
03-16-2013, 07:24 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#24
RE: [Help] Envy the Dead Developemt & Scripting Questions

(03-16-2013, 07:24 PM)plutomaniac Wrote: Something that also bumps me is that when I use AddUseItemCallback even if I set the boolean to true in the end, the item is not automatically removed and thus I have to use RemoveItem. Is this normal?

The wiki article may say to remove the item, but it's actually removing the callback so that using the item again won't trigger the callback.

Tutorials: From Noob to Pro
03-16-2013, 08:15 PM
Website Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#25
RE: [Help] Envy the Dead Developemt & Scripting Questions

I searched the wiki today to find the special words that you can use when making notes/diaries but I found that there was nothing about them there. So far I know [br] [new_page] and [voice sound.ogg]. Are there more? I want to leave space between two words.
03-18-2013, 08:57 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#26
RE: [Help] Envy the Dead Developemt & Scripting Questions

(03-18-2013, 08:57 PM)plutomaniac Wrote: I searched the wiki today to find the special words that you can use when making notes/diaries but I found that there was nothing about them there. So far I know [br] [new_page] and [voice sound.ogg]. Are there more? I want to leave space between two words.

The only reason i know about those is because i looked for them in the game's original lang file.

Tutorials: From Noob to Pro
03-18-2013, 10:03 PM
Website Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#27
RE: [Help] Envy the Dead Developemt & Scripting Questions

(03-18-2013, 10:03 PM)Your Computer Wrote: The only reason i know about those is because i looked for them in the game's original lang file.

Yes I learned these from you. So as far as I understand it is not possible to do this:

Dear XXX,                            17.8.2013

Yesterday...
03-18-2013, 10:24 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#28
RE: [Help] Envy the Dead Developemt & Scripting Questions

Try to be creative. Use a lot of space to simulate it.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
03-20-2013, 06:03 PM
Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#29
RE: [Help] Envy the Dead Developemt & Scripting Questions

spaces do not seem to be registered for some reason. Of course I tried that first.
03-20-2013, 06:03 PM
Find
plutomaniac Offline
Super Moderator

Posts: 6,368
Threads: 45
Joined: May 2011
Reputation: 183
#30
RE: [Help] Envy the Dead Developemt & Scripting Questions

Is there a way to add 1 to a global variable? I tried many things and this is the best I have though to do so far:

PHP Code: (Select All)
int tempvar 0;

void OnStart()
{  
    
AddGlobalVarInt("globalvar"0);
    
tempvar GetGlobalVarInt("globalvar");

    
SetEntityCallbackFunc("paper01""Something");
}

void Something(string &in entitystring &in type)
{
    if(
entity == "paper01")
    {
        
SetGlobalVarInt("globalvar"tempvar++);
    }


EDIT: Go it! This works instead:

PHP Code: (Select All)
void Something(string &in entitystring &in type)
{
    if(
entity == "paper01")
    {
        
tempvar++;
        
SetGlobalVarInt("globalvar"tempvar);
    }

(This post was last modified: 03-21-2013, 08:08 PM by plutomaniac.)
03-21-2013, 08:03 PM
Find




Users browsing this thread: 1 Guest(s)