Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use additementity and remove item?
Author Message
MissMarilynn Offline
Member

Posts: 77
Joined: Oct 2011
Reputation: 1
Post: #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 all posts by this user Quote this message in a reply
Stepper321 Offline
Senior Member

Posts: 263
Joined: Nov 2011
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #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 all posts by this user Quote this message in a reply
Stepper321 Offline
Senior Member

Posts: 263
Joined: Nov 2011
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
MissMarilynn Offline
Member

Posts: 77
Joined: Oct 2011
Reputation: 1
Post: #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 all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 235
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #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 all posts by this user Quote this message in a reply
MissMarilynn Offline
Member

Posts: 77
Joined: Oct 2011
Reputation: 1
Post: #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 all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

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

Yup! That'll work.

Dark Seclusion Here
05-16-2012 01:56 AM
Find all posts by this user Quote this message in a reply
Stepper321 Offline
Senior Member

Posts: 263
Joined: Nov 2011
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)