Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
'Slime puzzle'
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
(This post was last modified: 12-18-2011, 09:51 PM by Quotentote.)
|
|
12-18-2011, 02:37 PM |
|
Dobbydoo
Member
Posts: 50
Threads: 6
Joined: Aug 2011
Reputation:
0
|
RE: 'Slime puzzle'
I guess you would want to do something like this.
AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);
void MyFunc(string &in asItem, string &in asEntity) { SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);
}
|
|
12-18-2011, 03:07 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: 'Slime puzzle'
AddUseItemCallback("", "pot1", "slime1", "slime", bool abAutoDestroy);
void slime(string &in asItem, string &in asEntity) { SetPropActiveAndFade("slime1", bool abActive, float 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 |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: 'Slime puzzle'
(12-18-2011, 03:22 PM)Quotentote Wrote: AddUseItemCallback("", "pot1", "slime1", "slime", bool abAutoDestroy);
void slime(string &in asItem, string &in asEntity) { SetPropActiveAndFade("slime1", bool abActive, float 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);
}
(This post was last modified: 12-18-2011, 03:32 PM by flamez3.)
|
|
12-18-2011, 03:31 PM |
|
Dobbydoo
Member
Posts: 50
Threads: 6
Joined: Aug 2011
Reputation:
0
|
RE: 'Slime puzzle'
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.
(This post was last modified: 12-18-2011, 03:54 PM by Dobbydoo.)
|
|
12-18-2011, 03:53 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: 'Slime puzzle'
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
(This post was last modified: 12-18-2011, 04:05 PM by Quotentote.)
|
|
12-18-2011, 04:00 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: 'Slime puzzle'
(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.
(This post was last modified: 12-18-2011, 04:42 PM by flamez3.)
|
|
12-18-2011, 04:41 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: 'Slime puzzle'
hooray it works ty very much
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
void looking(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("lookto", 10, 50, ""); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false); PlaySoundAtEntity("", "15_the_big_scream.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); AddTimer("", 2, "TimerStopPlayerLook"); }
void TimerStopPlayerLook (string &in asTimer) { StopPlayerLookAt(); }
|
|
12-18-2011, 05:47 PM |
|
|