Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Teleporting items & Vaporizing items
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#1
Teleporting items & Vaporizing items

I need help with two things..
1)
I want to teleport an item every time it's leaving the selected area back inside so it will triger the commands again...I tried some commands but the item stops being usable.

2)
I would like to vaporize any item that touches the acid... I know that there is vaporizing comands in the main story scripts but it is really confusing and i couldn't use it on any other map(Of course with modifications).

Sorry for any English mistakes I made.

[Image: 2H1Mc.jpg]
(This post was last modified: 10-21-2012, 06:38 PM by ZodiaC.)
10-21-2012, 01:46 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Teleporting items & Vaporizing items

How many items are we talking about vaporizing?

Trying is the first step to success.
10-21-2012, 08:19 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Teleporting items & Vaporizing items

(10-21-2012, 01:46 AM)belikov Wrote: I need help with two things..
1)
I want to teleport an item every time it's leaving the selected area back inside so it will triger the commands again...I tried some commands but the item stops being usable.

2)
I would like to vaporize any item that touches the acid... I know that there is vaporizing comands in the main story scripts but it is really confusing and i couldn't use it on any other map(Of course with modifications).

Sorry for any English mistakes I made.
For 1 (I don't really know if you can teleport items, but):

AddEntityCollideCallback("nameoftheitem", "ScriptTele", "Tele", false, -1);

For 2:

SetPropActiveAndFade("nameofitem", false, 3);

Play with the values so you get the desired effect.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-21-2012, 01:35 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#4
RE: Teleporting items & Vaporizing items

(10-21-2012, 08:19 AM)beecake Wrote: How many items are we talking about vaporizing?
Well in the main story (map:ch02/15_prison_north) all the itams in the area are vaporizable except glass and metal.I would like to do it with all the items in the area too(I dont care about glass and metal).

(10-21-2012, 01:35 PM)The chaser Wrote:
(10-21-2012, 01:46 AM)belikov Wrote: I need help with two things..
1)
I want to teleport an item every time it's leaving the selected area back inside so it will triger the commands again...I tried some commands but the item stops being usable.

2)
I would like to vaporize any item that touches the acid... I know that there is vaporizing comands in the main story scripts but it is really confusing and i couldn't use it on any other map(Of course with modifications).

Sorry for any English mistakes I made.
For 1 (I don't really know if you can teleport items, but):

AddEntityCollideCallback("nameoftheitem", "ScriptTele", "Tele", false, -1);

For 2:

SetPropActiveAndFade("nameofitem", false, 3);

Play with the values so you get the desired effect.
About the 1)
Would the script work on that item as it was previously(before it got teleported)?

And about the 2)
I know that command but...Is it possible to vaporize all items without using this on every item name, I mean in the main story the algorith is about 20 lines without naming every item separately.

[Image: 2H1Mc.jpg]
(This post was last modified: 10-21-2012, 03:12 PM by ZodiaC.)
10-21-2012, 03:06 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Teleporting items & Vaporizing items

use a for script where all boxes call vaporize function and all everything else Wink

Then the script:

void Vaporize(string &in asParent, string &in asChild, int alState)
{
SetPropActiveAndFade(asParent, false, 1);
}

Trying is the first step to success.
10-21-2012, 03:20 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#6
RE: Teleporting items & Vaporizing items

(10-21-2012, 03:20 PM)beecake Wrote: use a for script where all boxes call vaporize function and all everything else Wink

Then the script:

void Vaporize(string &in asParent, string &in asChild, int alState)
{
SetPropActiveAndFade(asParent, false, 1);
}
Could you make a small example because i don't get it? :/

[Image: 2H1Mc.jpg]
10-21-2012, 04:12 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Teleporting items & Vaporizing items

void OnStart()
{
for(int p=1;p<100;p++) AddEntityCollideCallback("hammer_"+p, "AREA", "VAPORIZING", false, 1);
for(int p=1;p<100;p++) AddEntityCollideCallback("box_"+p, "AREA", "VAPORIZING", false, 1);
for(int p=1;p<100;p++) AddEntityCollideCallback("longbox_"+p, "AREA", "VAPORIZING", false, 1);
}

void VAPORIZING(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", asParent, false);
SetPropActiveAndFade(asParent, false, 1);
PlayGuiSound("ui_fire_damage", 4);
}

Trying is the first step to success.
(This post was last modified: 10-21-2012, 05:27 PM by FlawlessHappiness.)
10-21-2012, 05:23 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#8
Smile  RE: Teleporting items & Vaporizing items

(10-21-2012, 05:23 PM)beecake Wrote: void OnStart()
{
for(int p=1;p<100;p++) AddEntityCollideCallback("hammer_"+p, "AREA", "VAPORIZING", false, 1);
for(int p=1;p<100;p++) AddEntityCollideCallback("box_"+p, "AREA", "VAPORIZING", false, 1);
for(int p=1;p<100;p++) AddEntityCollideCallback("longbox_"+p, "AREA", "VAPORIZING", false, 1);
}

void VAPORIZING(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", asParent, false);
SetPropActiveAndFade(asParent, false, 1);
PlayGuiSound("ui_fire_damage", 4);
}
It works perfectly!I didn't know that the "For" command can be used as in the C language...Maybe i could use it for my 1) problem too...Anyway thank you for help!You helped me both of you! Big Grin

[Image: 2H1Mc.jpg]
10-21-2012, 06:37 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: Teleporting items & Vaporizing items

you can always use the ""+something Smile

I sometimes do this: AddTimer("Timer_"+RandInt(1, 3), 5, "Timer");

void Timer(string &in asTimer)
{
if(asTimer == "Timer_1")
{

}


if(asTimer == "Timer_2")
{

}


if(asTimer == "Timer_3")
{

}
}

understand?

Trying is the first step to success.
(This post was last modified: 10-21-2012, 06:50 PM by FlawlessHappiness.)
10-21-2012, 06:49 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#10
RE: Teleporting items & Vaporizing items

(10-21-2012, 06:49 PM)beecake Wrote: you can always use the ""+something Smile

I sometimes do this: AddTimer("Timer_"+RandInt(1, 3), 5, "Timer");

void Timer(string &in asTimer)
{
if(asTimer == "Timer_1")
{

}


if(asTimer == "Timer_2")
{

}


if(asTimer == "Timer_3")
{

}
}

understand?
well i got the "For" command
but this confuses me.. :/
The "Timer_"+RandInt(1, 3)" makes 3 timers with names : Timer_1,Timer_2 and Timer_3 ?
And what exactly you compare in the "If" commands?

[Image: 2H1Mc.jpg]
10-21-2012, 09:46 PM
Find




Users browsing this thread: 1 Guest(s)