Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
action to distribute game jewels in a circel when triggered from a center position:
|
||||
|
Hmm cant post other two scripts: linear distribution and square distribution? why why now what for |
||||
|
Could you maybe please provide a small demo .ccb? Thanks for sharing @DouweDabbe! |
||||
|
Thanks! for sharing these 3 amazing scripts @DouweDabbe. |
||||
|
@Just_in_case *hmph |
||||
|
@DouweDabbe, I tried using the circular script, but I am unable to use it, If you can provide tutorial or CCb files for that. Please provide Usage instructions at least. Edit:- have to study the source in order to understand how it works, It seems we have to use folders. But A tutorial or usage instruction will be great so that everybody can use it easily. Alright after studying and analyzing the source I got it working, It requires the end user to change or modify the behavior in order to work with this action. the action uses names like gun-0, dollar-0, and all you might need to change these names in the action with your node names, or has to rename your nodes with the values from this action. also, you need to create a folder and put the treasure in that folder. if executed multiple times can freeze or crash the game. it is good to distribute treasures only once and it will definately requires you to have modify the script. |
||||
|
I hoped the code would to be self explanatory. Developing Games requires tons of testing = boring work. Therefore made these 3 jewel distribution scripts, to add some event driven randomness. I am still struggling with debugging, therefore I have begun to use a naming convention: - node names first letter is nodetype: (m)esh, (o)verlay, etc. - variable names first letter is var type (g)lobal, s(tring), (i)nt, (f)loat, (o)bject, etc. I also like to bundle my data into (C-language like structs): var gPlayer { name : "", positionx : 0, positionz : 0, positiony : 0, points : 0 } PS: cant use ccbcommands in mygame.js files var Johnny = new gPlayer; // (g)lobal var var Peter = new gPlayer; this is beneficial if I need to pass aguments to some function var route = findPath(Johnny, Peter); attackPeter(Johnny, route); @just_in_case Yess it is very beneficial to create sample ccb files for every script, so the novice user can visualize and investigate its usage. will see to upload one. I did not experience CC crashes, But long Manna data strings (100 letters) do slowdown the square script quite a bit. all gems are cloned from prototypes in fLibrary (f)older node all gems are billboards, you can change that, names should be bGun-0, bLiquor-0, bDollar-0, idea was to use a auto numbering naming routine, not implemented yet. all gems are parented to fTreasure (f)older node. So we can iterate through fTreasure to keep scores, i.e. 4 of 12 monsters destoyed. Indeed this script is not just for distributing assets / jewels, but can also be used to place enemies or bad luck and traps as well. Hope that helps. |
|