Frictional Games Forum (read-only)

Full Version: 'Slime puzzle'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi i need help again...

i want a pot of acid to destroy this organic slime stuff.

i was just trying around and tried:

AddEntityCollideCallback("pot1", "slimeaway", "slime", true, 1);

void slime(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("slime1", false);
}

do i have to combine something or is this kind of script not the right one?

ty for answers
quotentote
I guess you would want to do something like this.

PHP Code:
AddUseItemCallback(stringasNamestringasItemstringasEntitystringasFunctionbool abAutoDestroy);

void MyFunc(string &in asItemstring &in asEntity)
{
SetPropActiveAndFade(stringasNamebool abActivefloat afFadeTime);


PHP Code:
AddUseItemCallback("""pot1""slime1""slime"bool abAutoDestroy);

void slime(string &in asItemstring &in asEntity)
{
SetPropActiveAndFade("slime1"bool abActivefloat afFadeTime);



so i dont need an area for that?

as i try to start the map i got an error...blabla 'expected '(''
sorry for my questions :/ just new in scripting
(12-18-2011, 03:22 PM)Quotentote Wrote: [ -> ]
PHP Code:
AddUseItemCallback("""pot1""slime1""slime"bool abAutoDestroy);

void slime(string &in asItemstring &in asEntity)
{
SetPropActiveAndFade("slime1"bool abActivefloat afFadeTime);



so i dont need an area for that?

as i try to start the map i got an error...blabla 'expected '(''
sorry for my questions :/ just new in scripting
Your using a item with a Entity, that's not a area.

void OnStart()
{
AddUseItemCallback("", "nameofpotion", "nameofentityyourusingthepotionon, "slime, false);
}

void slime(string &in asItem, string &in asEntity)
{
SetEntityActive("nameofslime", false);
OR
SetPropActiveAndFade("nameofslime, true, 1.0f);
}


If you want to make it more fancy you could also add some particle effects, and you should add sounds no matter what. If you want to take it to the extreme you could also make an animation with the acid being poured onto the slime.
it almost works!
i took your
SetPropActiveAndFade("nameofslime", true, 1.0f);

but it faded 'backwards'...it despawns first and then it appears with that fading effect xD

(12-18-2011, 03:53 PM)Dobbydoo Wrote: [ -> ]If you want to make it more fancy you could also add some particle effects, and you should add sounds no matter what. If you want to take it to the extreme you could also make an animation with the acid being poured onto the slime.

ofc i will add a sound but first it has to work ^^ and particles...as i said im REALLY new in scripting/mapping... its the first time i do something like that. i also got some problems with a sound... i created an area where the player is forced to look at...sound works great but i can hear it around the hole map sometimes xD
(12-18-2011, 04:00 PM)Quotentote Wrote: [ -> ]it almost works!
i took your
SetPropActiveAndFade("nameofslime", true, 1.0f);

but it faded 'backwards'...it despawns first and then it appears with that fading effect xD

(12-18-2011, 03:53 PM)Dobbydoo Wrote: [ -> ]If you want to make it more fancy you could also add some particle effects, and you should add sounds no matter what. If you want to take it to the extreme you could also make an animation with the acid being poured onto the slime.

ofc i will add a sound but first it has to work ^^ and particles...as i said im REALLY new in scripting/mapping... its the first time i do something like that. i also got some problems with a sound... i created an area where the player is forced to look at...sound works great but i can hear it around the hole map sometimes xD
I'm not sure if it will work , but change the true to false. Also with the sound not being able to be heard across the map. Click on the sound in the level editor and change the max distance. That will change the distance it can be heard.
hooray it works Smile ty very much Smile
and the sound... its not an sound-zone i created in an area its a sound from my script file. i can hear it on random places in my map... like a loop or something

PHP Code:
void looking(string &in asParentstring &in asChildint alState)
{
   
    
StartPlayerLookAt("lookto"1050"");
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
PlaySoundAtEntity("""15_the_big_scream.snt""Player"0false);
    
GiveSanityDamage(5.0ftrue);
    
AddTimer(""2"TimerStopPlayerLook");
}

void TimerStopPlayerLook (string &in asTimer)
{
    
StopPlayerLookAt();