Frictional Games Forum (read-only)
[SOLVED] Script won't recogize edited .ent - 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: [SOLVED] Script won't recogize edited .ent (/thread-29856.html)



[SOLVED] Script won't recogize edited .ent - A.M Team - 04-26-2015

Heres the .hps file:
PHP Code:
void OnStart()
{
    
SetEntityPos("chem_chem"15.2010, -3.024, -36.407);
    
StartPlayerLookAt("note_fire"1.21.5"TheCastleWentUpInFlamesAndItsAllYourFaultYouTurd");
    
AddUseItemCallback("hcp""stone_hammer_chipper""hammer_smash""HammerSmash"false);
    
PreloadParticleSystem("ps_door_damage_wood.ps");
    
PreloadParticleSystem("ps_dust_elevator_crash.ps");
    
PreloadParticleSystem("ps_scare_pulse.ps");
    
PreloadParticleSystem("ps_dust_impact.ps");
    
PreloadSound("21_intro_scream.snt");
    
PreloadSound("20_bend_pipe.snt");
    
PreloadSound("13_machine_run.snt");
    
SetNPCAwake("jerry"falsefalse);
}

void FIRE(string &in asEntitystring &in asType)
{
    
AddTimer("firetimer"0.01"FireTime");
}

void FireTime(string &in asTimer)
{
    
StopPlayerLookAt();
    
AddQuest("Investigate""firefire");
    
GiveHint ("fired""Hints""fired"3);
}

void HammerSmash(string &in asItemstring &in asEntity)
{
    
CreateParticleSystemAtEntity("ps_door_damage_wood""ps_door_damage_wood.ps""hammer_smash_door"false);
    
PlayGuiSound("break_wood_metal1.ogg"1);
    
SetPropActiveAndFade("hammer_smash_door"false0.5);
    
CreateParticleSystemAtEntity("ps_dust_elevator_crash""ps_dust_elevator_crash.ps""hammer_smash_door"false);
    
CreateParticleSystemAtEntity("ps_scare_pulse""ps_scare_pulse.ps""hammer_smash_door"false);
    
CreateParticleSystemAtEntity("ps_dust_impact.ps""ps_dust_impact.ps""hammer_smash_door"false);
    
SetEntityPlayerInteractCallback("chemie""LA"true);
}

void LA(string &in asItem)
{
    
AddEntityCollideCallback("Player""SpookArea""AAA"true, -1);
    
AddUseItemCallback("""chemie""acid_con""AcidGet"true);
}

void AAA(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("SCREAM""21_intro_scream.snt""spooky"0false);
    
GiveSanityDamage(35true);
    
SetEntityActive("spooky"true);
    
SetEntityActive("jerry"true);
    
SetNPCAwake("jerry"truetrue);
    
SetEntityPlayerLookAtCallback("jerry""WALKON"true);
}

void WALKON(string &in asEntityint alState
{
    
AddEnemyPatrolNode("jerry""PathNodeArea_1"0.001"");
    
AddEnemyPatrolNode("jerry""PathNodeArea_2"0.001"");
    
AddEnemyPatrolNode("jerry""PathNodeArea_3"0.001"");
    
AddEnemyPatrolNode("jerry""PathNodeArea_4"0.001"");
    
AddEnemyPatrolNode("jerry""PathNodeArea_5"7"idle_extra2");
}

void AcidGet (string &in asItemstring &in asEntity)
{
    
AddTimer("acid_done"2"AcidDone");
    
FadeInSound("16_water_stream_heavy.snt"0.1true);
    
SetEntityPos("chem_chem", -15.541, -3.024, -36.407);
}

void AcidDone(string &in asTimer)
{
    
SetEntityPos("chem_chem"15.2010, -3.024, -36.407);
    
StopSound("16_water_stream_heavy.snt"0.5);


The entity is an edited container item ("chem_chem"), used as a visual representation of filling the container. I want it to be visible when you place the item over a script area, but it's still visible. I tried using item activating and it still won't recognize the .ent. Huh


RE: Script won't recogize edited .ent - Mudbill - 04-26-2015

Can you explain a bit more? Are you saying it's INvisible? As in not there?


RE: Script won't recogize edited .ent - FlawlessHappiness - 04-26-2015

(04-26-2015, 04:37 PM)TheDoctorPoo Wrote: I want it to be visible when you place the item over a script area, but it's still visible.

So... what is the problem?


RE: Script won't recogize edited .ent - A.M Team - 04-26-2015

I wan't this .ent file to be moved outside the map (invisible), notice the move entity position script. UNTIL I use an item on an area, then it will move back to its original position attached to a machine.

BUT its not recognizing the entity's name, (chem_chem). Why? Huh

EDIT: It turned out that static objects can't move via script. I'm retarded...


RE: Script won't recogize edited .ent - FlawlessHappiness - 04-26-2015

Show us a picture of the name of the entity in the map.



The following is not correct. See next comment for clarification of what I meant.
Spoiler below!

Make sure the entity isn't a static entity. (This can be checked in the model editor)
A static object would look like this in the model editor:
[Image: 7dc346761b.png]
These entities cannot be set active nor inactive. I don't know if they can be moved though.




RE: [SOLVED] Script won't recogize edited .ent - Mudbill - 04-26-2015

Actually, Object > Static can be scripted, but not the default StaticProp type.


RE: [SOLVED] Script won't recogize edited .ent - FlawlessHappiness - 04-26-2015

(04-26-2015, 08:11 PM)Mudbill Wrote: Actually, Object > Static can be scripted, but not the default StaticProp type.

Oh right, fuck... Sorry.
That's what I meant..