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
Doubt about a puzzle idea (script)
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#15
RE: Doubt about a puzzle idea (script)

So ResetProp() isn't working?

If so, then what you can do is create new objects in their place.
First create a script area where the vases are located, then use a script like this:

PHP Code: (Select All)
CreateEntityAtArea("vase_1""vase_file.ent""area_vase_1"false); 

"vase_1" is the entity name that will be created, so basically you need to loop this for the amount of vases you have. "vase_file.ent" is the entity file, which is somewhere in the entities folder. Just find out what it's called. It should be listed at the bottom of the "General" tab in the level editor. "area_vase_1" is the name of the script area that is placed on the vase.

When you place the script areas down, I recommend you name them "area_" + the name of the vase that is there. That way you can use this loop to create the new vases:

PHP Code: (Select All)
for(int i 1<= 4i++) {
    
CreateEntityAtArea("vase_"+i"vase_file.ent""area_vase_"+ifalse);


This will loop 4 times and create vase_1, vase_2, vase_3 and vase_4. Edit the '4' inside the for-loop to match the amount of vases you have. Run this inside your CheckPoint callback.

Edit: Actually, this might create more than wanted in case the player didn't break all the vases. Perhaps that's fixed by setting the previous vases inactive.

PHP Code: (Select All)
for(int i 1<= 4i++) {
    
SetEntityActive("vase_"+ifalse);
    
CreateEntityAtArea("vase_"+i"vase_file.ent""area_vase_"+ifalse);


This might fix that. Use this instead of the previous code.

(This post was last modified: 03-09-2016, 05:21 PM by Mudbill.)
03-09-2016, 05:15 PM
Find


Messages In This Thread
RE: Doubt about a puzzle idea (script) - by Mudbill - 03-09-2016, 05:15 PM



Users browsing this thread: 1 Guest(s)