You need to update to ExtraForYouAreNotAlone 1.1.4 or above.
We will create a stone slab that animals will avoid and work as a "gate".
Sprites>Other
Create a new sprite sprStoneSlab
Load sprite and find bckDungeon.png in our current project folder >Background>Images
Edit
Copy the flat rocks
Remove the old image
create a new 35x35
Paste it
Move it to the top left corner.
Transform>Crop
0 border
Transform>Stretch
32x32
Duplicate sprStoneSlab to sprStoneSlab_Object
Transform>Stretch
16x16
Duplicate sprStoneSlab to sprStoneSlab_Inventory
Transform>Stretch
160x160
To place slabs we need to set them as a weapon.
Duplicate objSeeds_Carrot to objStoneSlab_Object
Set sprite to sprStoneSlab_Object
scr_Multiplayer_OBJECT_ARRAY_Enviroment
Enviroment_Object_array[63]=objStoneSlab_Object;
Duplicate ItemGetStone to ItemGetStoneSlab
_item[ITEM_NAME] = "Stone slab";
_item[ITEM_OBJECT] = objStoneSlab_Object;
_item[ITEM_DESCRIPTION] = "A stone slab keep animals away";
_item[ITEM_ICON] = sprStoneSlab_Inventory;
_item[ITEM_DATA] = "PlaceAbleGrid;objStoneSlab_Once;json";
Ok. Lets make us pick it up.
objPlayerCharacter>parCollectible_Weapons
case objStoneSlab_Object: item=ItemGetStoneSlab(); break;
scr_Multiplayer_ON_PLAYER_REQUEST_OBJECT_GRANTED
case objStoneSlab_Object: var item=ItemGetStoneSlab(); // Set data fom pickup item item=scr_Multiplayer_Data_Get(data_,item); InventoryAdd(item); break;
We will now create the new obstacle for animals.
Duplicate parObstacleFull to parObstacleFull_Animals. (Note that I wrote wrong in the video!!!)
parObstacleFull
Set parent to parObstacleFull_Animals
Duplicate objStone to objStoneSlab
Set sprite to sprStoneSlab
Set parent to parObstacleFull_Animals
Step event
We want it to drop the slab objects.
var _newGem = instance_create(x+16, y+16, objStoneSlab_Object); scr_Multiplayer_Object_SyncCreate(0, objStoneSlab_Object, room, x+16, y+16);
Duplicate objStone_Once to objStoneSlab_Once
Set sprite to sprStoneSlab
Set parent to objStoneSlab
Step event
var _newGem = instance_create(x+16, y+16, objStoneSlab_Object); scr_Multiplayer_Object_SyncCreate(0, objStoneSlab_Object, room, x+16, y+16);
scr_Multiplayer_OBJECT_ARRAY_Enviroment
Enviroment_Object_array[64]=objStoneSlab; Enviroment_Object_array[65]=objStoneSlab_Once;
Once again this is a complete new object. So we must make the engine handle it.
scr_Multiplayer_ON_DESTROY_Enviroment
Copy the CheckObject=objStone; and paste it below
CheckObject=objStoneSlab;
scr_Multiplayer_ON_PLAYER_REQUEST_OBJECT_GRANTED
Copy CheckObject=objStone; and paste it below
CheckObject=objStoneSlab; // Destroyed a Stone Slab
Player>objPlayer
Room start event
In // Activate all "hidden" objects
instance_activate_object(objStoneSlab);
We will now make so the pickaxe can remove stone slabs
objPlayerStrike
Duplicate objStone Collision event to objStoneSlab
Ok. We now need to make the animals collide with the stone slabs
Mobiles>Dociles>objChicken
Step event
In // Handle collisions
MobileDoCollision(horiSpeed, vertSpeed, parObstacleFull_Animals);
This will make the chicken collide with obstacles that got parents parObstacleFull_Animals, parObstacleFull and parObstacle
The player only got collision with parObstacle and will only collide with parObstacle nor parObstacleFull or parObstacleFull_Animals.
So the player can walk through objects that got parObstacleFull and parObstacleFull_Animals as parents.
objChicken_Once
Step event
MobileDoCollision(horiSpeed, vertSpeed, parObstacleFull_Animals);
Copy the collision chunk
objCowScorpion_Once
Step event
Paste the chunk
I forgot this in the "Cow" tutorial. So the Cow just sat there unmoveable. But now we fixed that.
Ok lets place some stone slabs in the room.
And we go for a test run.
And we can walk over the slabs.
And the "Cow" cant walk over the slabs.
This will work as a "gate" for us. You can complicate things and animate a door that open when the player come near. But i leave that for you. For now :-)
For more infomation >> 5 Simple Steps to Boost Metabolism - Duration: 4:04. 





For more infomation >> health tips in urdu | ہمیشہ جوان اور فٹ رہنے کا جادوئی نسخہ | hamesha jawan rehne ka tarika - Duration: 2:28. 
For more infomation >> Fargo Sneak Peek - Duration: 1:33. 
For more infomation >> Top Gear: Extra Gear - Episode 4 - Duration: 23:52. 




For more infomation >> Desi, You Got Some 'Splainin' To Do - Duration: 41:33. 
Không có nhận xét nào:
Đăng nhận xét