Frictional Games Forum (read-only)
Video Tutorials [OMG ELEVEN!!!!] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Articles (https://www.frictionalgames.com/forum/forum-40.html)
+---- Thread: Video Tutorials [OMG ELEVEN!!!!] (/thread-7608.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: Video Tutorials [FIRST VIDEO IS UP] - Anxt - 04-25-2011

I have my first video recorded, it covers the basics of building a map in the level editor. I just need to upload it to youtube and I will post the link in this thread.


RE: Video Tutorials [FIRST VIDEO IS UP] - Simpanra - 04-25-2011

(04-25-2011, 03:57 PM)Anxt Wrote: I have my first video recorded, it covers the basics of building a map in the level editor. I just need to upload it to youtube and I will post the link in this thread.

Brilliant! I can't wait =)
I will put the link in the first post when it's up if you like? =)


RE: Video Tutorials [FIRST VIDEO IS UP] - Dalroc - 04-25-2011

You should indent your code.. Especially if you are going to teach others to script.

I guess I could explain for you what the "string& asName", "float afTime", "string& asFunction" and all those mean.

Lets use your own tutorial as example.
In your AddEntityCollideCallback you have the parameters "Player", "RoomTwoArea" and "1".
In you CollideRoomTwo function you "import" these parameters with a new name you specify.

So
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
calls
CollideRoomTwo(string &in asParent, string &in asChild, int &in alState)
This means Player is now a variable named asParent inside of the CollideRoomTwo function, RoomTwoArea is named asChild and the 1 in stored inside an integer variable called alState.

Now this doesn't really change anything for this specific script, but it's good for doing a general function that you use several times for several different entities and locations (unlocking doors, ambient noises, levers).

Example, this code would unlock any door that calls it:
PHP Code:
void KeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door.snt"asEntity0false);




RE: Video Tutorials [FIRST VIDEO IS UP] - Simpanra - 04-25-2011

Ah i see, that makes sense =)
And sorry abou the indenting, i will do that from now on =)


RE: Video Tutorials [FIRST VIDEO IS UP] - Anxt - 04-25-2011

Video is being uploaded now, it will probably take a while though.

And yes, I would love for it to be on the first page Smile

I'll post a link when it is ready.


RE: Video Tutorials [FIRST VIDEO IS UP] - Exostalker - 04-25-2011

I didn't want to create a new thread, so I just post this problem here:

How to remove particles from level editor? Let's say with light I spawn some dust particles, and they start to lag level editor... How do I remove them? Removing the light itself doesn't work, nothing seems to work with this...

EDIT: Reopening the map seems to fix this.


RE: Video Tutorials [FIRST VIDEO IS UP] - Simpanra - 04-25-2011

(04-25-2011, 05:56 PM)Exostalker Wrote: I didn't want to create a new thread, so I just post this problem here:

How to remove particles from level editor? Let's say with light I spawn some dust particles, and they start to lag level editor... How do I remove them? Removing the light itself doesn't work, nothing seems to work with this...

EDIT: Reopening the map seems to fix this.

Just click the floating PS icon in the editor, and hit backspace to delete it =)


RE: Video Tutorials [FIRST VIDEO IS UP] - Exostalker - 04-25-2011

(04-25-2011, 06:30 PM)Simpanra Wrote:
(04-25-2011, 05:56 PM)Exostalker Wrote: I didn't want to create a new thread, so I just post this problem here:

How to remove particles from level editor? Let's say with light I spawn some dust particles, and they start to lag level editor... How do I remove them? Removing the light itself doesn't work, nothing seems to work with this...

EDIT: Reopening the map seems to fix this.

Just click the floating PS icon in the editor, and hit backspace to delete it =)

Yeah, it would normally work like that. I created those particles with light, not with system Big Grin


RE: Video Tutorials [FIRST VIDEO IS UP] - Anxt - 04-25-2011

Well, while we're at it, I am having a bit of an issue myself. In my custom story, the player must combine a hammer and chipper to destroy a padlock. Before the Justine patch, my code worked fine, and they combined properly. Since then, however, it has not worked, nor has any combine callback. I have tried updating my code in concordance with the script functions page, but it is still not working.

Here is the function in question:

Code:
void CombineHammerAndChipper(string &in asItemA, string &in asItemB)
{
    
    if(asItemA == "stone_hammer_1" && HasItem("stone_chipper_1")){
    
        RemoveItem("stone_chipper_1");
        RemoveItem("stone_hammer_1");
        
        GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);    
    }
    else if(asItemA == "stone_chipper_1" && HasItem("stone_hammer_1")){
        
        RemoveItem("stone_chipper_1");
        RemoveItem("stone_hammer_1");
        
        GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);    
    }
}

Any ideas why it won't work?


RE: Video Tutorials [FIRST VIDEO IS UP] - MrBigzy - 04-25-2011

Perhaps the cache? Or maybe it needs to have the corresponding pfiles.