≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Randomize the positions of some scene nodes
Posted by:
(you are not logged in)
Enter the missing letter in: "Internationa?"
(you are not logged in)
Text:
[quote][b][/b] wrote: I remember you posted this with reference to my post in open discussion... Well ,I don't understand what you really want to do.. If your idea is to randomise positions of somescenenode when the game starts then you can do that easily... Use the behaviour or action set random value... Give the variable name positions... Provide minimum and maximum value like 0 and 10 And now add another action if a variable has value do something.. Now if variable positions has value 0 then execute javascript... [Code]Var s = Ccbgetscenenodebyname("enemy") CcbSetscenenodeproperty (s,'position', x,y,z);[/code] Here [b]x,y,z [/b]are the value for position.... Add same script for all the value of variable position like upto 10... But remember to use diffrent value of [b]x,y,z [/b]everytime... And you can also do this in another way by using math.random.... But i think you should try learning javascript.... If you are comfortable with the above method, and if your scene contains more scennode thatn one then you can do the same thing .. For example adding 10 positions for one scenenode to randomise... And another 10 for another scennode... To prevent the overlapping problem you can use diffrent variable name for diffrent character or try using difrrent minimum and maximum value... For example we have used minimum value '0' and maximum value '10' in the above example for variable position... Now we can either use diffrent variable like positionghost... Or we can use diffrent minimum and maximum like minmum '11' and maximum '20'... Thus scennodes will never get overlapped.... [B]Note:- if you want the scenenodea to be always on ground or terrain then don't change the value of 'Y', or if your scenenode has a behaviour applied 'collide whwn moved' then there will be jo problem they will always be on ground'[/b] And there is already an behaviour for this all you had to is before starting the scene do something... Then add action change position of a scenenode select your scenenode and choose [b]set to a random position in the area...[/b] and specify the minimum and maximum distance... Do this for all of your scenenodes... And dont use same minima and maxima to prevent from overlapping... Sorry, i wrote too much.... Hope you understand this..[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact