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
Final help with difficult script
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#11
RE: Final help with difficult script

(10-14-2010, 08:33 AM)DamnNoHtml Wrote:
(10-13-2010, 07:43 PM)LoneWolf Wrote: This is what i need to do.

I have 4 chemical jars, i need them to be able to be mixed into a pot. I then need to be able to place the pot onto the ground near a barricade. Then just like the game i need it to blow up when hit by a rock. I then need the barricade to disappear so that my other barricade(which the broken version) will only be visible.

Any idea how to do this, or atleast start as this is my last script thread.

What you are asking isn't really that hard to comprehend, it is just putting it into code.

Basically, you just have 4 AddCombineItemCallbacks for each of the jars. Then, you have a use item callback on the ground where you want the finished pot to go. Then, you add an AddEntityCollideCallback between a rock and the entity pot you just made. The callback for that function would probably shake the screen, fade out, set the barricade to inactive, and set the broken version to active.

Yeah, thanks for summing it up for me this should guide me to using the right functions, i'll get started today probably.
10-14-2010, 10:08 AM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#12
RE: Final help with difficult script

Ok i've not long started the scripting this is what i have (im not sure if i've set it out right at all, to me there seems to be something missing).

////////////////////////////
// Run first time starting map
void OnStart()
{
AddCombineCallback("Mixed chemical 1", "chemical1", "pot", Mixedchemical,

true);
AddCombineCallback("Mixed chemical 2", "chemical2", "pot", Mixedchemical,

true);
AddCombineCallback("Mixed chemical 3", "chemical3", "pot", Mixedchemical,

true);
AddCombineCallback("Mixed chemical 4", "chemical4", "pot", Mixedchemical,

true);
AddUseItemCallback("addpottoground", "pot", "ground", "addpottoground",

true);
AddEntityCollideCallback("player", "CaveInArea", "cavein", true, 1);

AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true,

1);
}
void cavein(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Sound_1", "explosion_rock_large.snt", "playsound", 0,

true);
StartScreenShake(5.0f, 5.0f, 5.0f,5.0f);
FadeOut(5.0f);
SetEntityActive("cavein1", false);

}

Dont mind the AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true,

this is for a path node for an enemy.
10-14-2010, 06:17 PM
Find




Users browsing this thread: 1 Guest(s)