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
How to use additementity and remove item?
MissMarilynn Offline
Member

Posts: 77
Threads: 23
Joined: Oct 2011
Reputation: 1
#1
How to use additementity and remove item?

Hello! Could someone explain how to use the scripting for additementity and how to script a remove item entity?

Thanks!

OH and could I use this to set an area active? How would I do that?
(This post was last modified: 05-15-2012, 01:48 PM by MissMarilynn.)
05-15-2012, 01:40 PM
Find Reply
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#2
RE: How to use additementity and remove item?

AddUseItemCallback("", "itemname", "entityname", "function", true); // Put this in void OnStart



then you add this too (i will do a door example.)

void function(string &in asItem, string &in asEntity)
{
RemoveItem(asItem);
SetSwingDoorLocked(asEntity, false, true);
}
How this works is by asItem, it's an advanced Syntax sort to speak, it will to say it easily look at the name function, and then to the function as stated. and look at the part of the item, for asItem, and entity for asEntity. Now when you want another one.
Just add the same with function. so you can use it over and over again Big Grin! Yay?

Signature to awesome to be displayed.
05-15-2012, 03:09 PM
Find Reply
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#3
RE: How to use additementity and remove item?

(05-15-2012, 01:40 PM)MissMarilynn Wrote: OH and could I use this to set an area active? How would I do that?
Inside Strepper's example function aptly named function, you can add:

if(asItem == "KeyThatActivatesArea")
{
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
}

That will tell the engine to start looking for a collision between the player and the script area.

Dark Seclusion Here
(This post was last modified: 05-15-2012, 06:26 PM by FragdaddyXXL.)
05-15-2012, 06:25 PM
Find Reply
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#4
RE: How to use additementity and remove item?

(05-15-2012, 06:25 PM)FragdaddyXXL Wrote:
(05-15-2012, 01:40 PM)MissMarilynn Wrote: OH and could I use this to set an area active? How would I do that?
Inside Strepper's example function aptly named function, you can add:

if(asItem == "KeyThatActivatesArea")
{
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
}

That will tell the engine to start looking for a collision between the player and the script area.
You can also do it in the entities tab. ItemInteractCallback. It's syntax is
void name(string &in Entity) // Choose your own name (the one you put in ItemInteractCallback)
{
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
}

Wich one you prefer tough.

Signature to awesome to be displayed.
(This post was last modified: 05-15-2012, 06:34 PM by Stepper321.)
05-15-2012, 06:33 PM
Find Reply
MissMarilynn Offline
Member

Posts: 77
Threads: 23
Joined: Oct 2011
Reputation: 1
#5
RE: How to use additementity and remove item?

Could I use RemoveEntity instead?

What I want to do is make a door disappear and make a destroyed one appear.
05-15-2012, 11:24 PM
Find Reply
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: How to use additementity and remove item?

(05-15-2012, 11:24 PM)MissMarilynn Wrote: Could I use RemoveEntity instead?

What I want to do is make a door disappear and make a destroyed one appear.

Swingdoors already do that when their health drops significantly.

Tutorials: From Noob to Pro
05-15-2012, 11:33 PM
Website Find Reply
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#7
RE: How to use additementity and remove item?

void SetPropHealth(string& asName, float afHealth);

That should do the trick, as Your Computer has said.

Dark Seclusion Here
05-16-2012, 01:07 AM
Find Reply
MissMarilynn Offline
Member

Posts: 77
Threads: 23
Joined: Oct 2011
Reputation: 1
#8
RE: How to use additementity and remove item?

so would this be correct:

SetPropHealth("mansion_2","0.0");
05-16-2012, 01:38 AM
Find Reply
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#9
RE: How to use additementity and remove item?

Yup! That'll work.

Dark Seclusion Here
05-16-2012, 01:56 AM
Find Reply
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#10
RE: How to use additementity and remove item?

(05-16-2012, 01:38 AM)MissMarilynn Wrote: so would this be correct:

SetPropHealth("mansion_2","0.0");
No, you don't put "0.0" at floats. It's 0 or 0.0f

Signature to awesome to be displayed.
05-16-2012, 02:26 PM
Find Reply




Users browsing this thread: 1 Guest(s)