Frictional Games Forum (read-only)
[SCRIPT] Some questions - 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 Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Some questions (/thread-14433.html)



Some questions - zombiehacker595 - 04-02-2012

1. FadeOut(0);
FadeIn(15);
PlayMusic("10_amb.ogg", true, 1, 1, 0, true);
StopMusic(0, 1);
AddPlayerSanity(25);

in this the music in game wont stop at all how do i stop it

2. how do i collect acid from an acid container entities>special> acid container

using a gass jar entities>item> glass container.

so getting a glass container clicking on the acid container with it and getting a glass container of acid?



RE: Some questions - heyitsrobert97 - 04-02-2012

For The Acid Part go

void OnStart()
{
AddUseItemCallback("", "jar", "acidcontainer", "pickacid", true);}

void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("jar");
GiveItem("", "glass_container_mix_done", "", "glass_container_mix_done
.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

and for music to stop it should be like this

StopMusic(0.5f, 0);

Remember that when it says float like in stop music you put it in decimal with f at the end
like 0.0f-10.0f
The give item might work but i have not used that command before.but then you have to create
another UseItemCallback for the thing you want to use the acid on. for example

{
AddUseItemCallback("", "acidjar", "acidobject", "dissolveacid", true);
}

void dissolvedacid(string &in asItem, string &in asEntity)
{
SetPropActiveAndFade("acidobject", false, 2.0f);
PlaySoundAtEntity("", "puzzle_acid.snt", "Player", 0, false);
RemoveItem("acidjar")
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
AddPlayerHealth(10.0f);
}

That Should Work Fine. Don't Worry I was like you. didn't know how to script or anything
(that was 3weeks ago) and now i'm used to it.






RE: Some questions - zombiehacker595 - 04-02-2012

(04-02-2012, 12:49 PM)heyitsrobert97 Wrote: For The Acid Part go

void OnStart()
{
AddUseItemCallback("", "jar", "acidcontainer", "pickacid", true);}

void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("jar");
GiveItem("", "glass_container_mix_done", "", "glass_container_mix_done
.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}

and for music to stop it should be like this

StopMusic(0.5f, 0);

Remember that when it says float like in stop music you put it in decimal with f at the end
like 0.0f-10.0f
The give item might work but i have not used that command before.but then you have to create
another UseItemCallback for the thing you want to use the acid on. for example

{
AddUseItemCallback("", "acidjar", "acidobject", "dissolveacid", true);
}

void dissolvedacid(string &in asItem, string &in asEntity)
{
SetPropActiveAndFade("acidobject", false, 2.0f);
PlaySoundAtEntity("", "puzzle_acid.snt", "Player", 0, false);
RemoveItem("acidjar")
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
AddPlayerHealth(10.0f);
}

That Should Work Fine. Don't Worry I was like you. didn't know how to script or anything
(that was 3weeks ago) and now i'm used to it.


for the first acid thing it said fatal error multiline strings are not allowed in this application? 18,46

AddUseItemCallback("", "chemical_container_1", "acid_container_1", "pickacid", true);


void pickacid(string &in asItem, string &in asEntity)
{
RemoveItem("chemical_container_1");
GiveItem("", "glass_container_mix_done", "", "glass_container_mix_done <------- something wrong in here runs fine without it just without i dont get anything but the beggining script worked it took my jar just didnt give anything back
.tga", 1.0f);
PlaySoundAtEntity("", "puzzle_acid_success.snt", "Player", 0, false);
}
oh but the music stopped perfectly Smile


RE: Some questions - Strembitsky - 04-02-2012

Multiline strings? When you have it in your script, is the second "glass_container_mix_done" on a second line? If it is, you are most likely using Notepad, which is very bad. Get notepad++.


RE: Some questions - zombiehacker595 - 04-02-2012

(04-02-2012, 02:35 PM)Strembitsky Wrote: Multiline strings? When you have it in your script, is the second "glass_container_mix_done" on a second line? If it is, you are most likely using Notepad, which is very bad. Get notepad++.


oh wow the whole game stuffed up because the .tga"); was on a different line to the beggining any way thanks its working fine now but Smile im not sure how to add an item name to it the mixture works but when i move my cursor over it has no name? ill rep thingy you if you can answer Smile