Official Forum
You are not logged in.
well, you all know that it is hard to create something with scripting, but i found a simple solution
just scripting isnt enough for it, you have to look in your folders and scenes also...
step 1
search for a nice scene (art or mech, doesnt matter)
i use one of my own scenes as an example, something simple...
link to the example
step 2
now you have a simple scene, saved as a phz file
search for the phz file, and change the file extension into .zip
step 3
open the zip file (extract or not, doesnt matter)
now you see 3 files
a text file, an image file, and a phn file
open the phn file with wordpad or an other text editor that doesnt show weird signs but text (notepad for instance doesnt work)
step 4
in the text you now see a couple of settings, but dont use them
search for this text: scene.addPlane {........
now remove all line breaks in the code (i suggest using this tool (thnx to standardtoaster)
step 5
now you have a very long line of code
copy this code (ctrl+c)
step 6
open phun, make a box and select it
search for the script menu (be sure advanced mode is enabled)
if you dont see the script menu, goto step 6.5, if you see the script menu, goto step 7
step 6.5
open the console (with ` )
type in: App.enableScriptMenu
yes, the caps does matter in this case
now, select the box again and search for the script menu (if it still isnt there, repeat this step, if it IS there, goto step 7)
step 7
once you have opened the script menu, search for: onCollide
this should be in the text box after that: (e)=>{}
set your cursor between the {}
step 8
press ctrl+v (if not the whole code appears, repeat this tut from step 3)
now press enter (or else the code wont be saved)
step 9
exit the script menu, and now make a mech to collide with the box that has the script when you press a key (enter as an example)
step 10
now put it on a fighter or something, and enjoy it spawning some simple fighting bots
thats it
notes:
u should take the planes out of the scene, or use a phunlet
this makes it spawn at only one place, but not in front of the object
to make it spawn infront of the object, paste "e.pos+[1, 1]+" after the =, but b4 the [
like this: "pos = [0.000001, 12.56]" becomes: pos = e.pos+[1, 1]+[0.000001, 1]
the 1 is becus otherwise it will fall from hight, but take always the same number to make it less (1 becomes -2, 40 becomes 37 etc...)
Last edited by Bronie12345 (2009-06-03 13:56:55)
Offline
Bronie12345 wrote:
now prepair for a long taking job: working the enters out (find and replace if very handy)
A better way to do it would be to go http://www.textfixer.com/tools/remove-line-breaks.php, paste your text in the top textbox, and check off remove line breaks and paragraph breaks.
Offline
thanx sdtoaster
ill add it to the tut ![]()
Offline
select the phz file
right mouse click on the phz file and click on: change filename
now you can change the filename...
change it to: temp.zip (or something like that)
you're done
if you dont see the file ext in the name, you should enable that in the windows folder view options... (dunno how it is at mac or linux)
Offline
this is for windows 7 (not on my own comp right now)
goto control panel
goto appearance and personalization
goto folder options
goto the tab: view
uncheck: hide extensions for known file types
for windows XP: (this will come here when im home)
Offline
Bronie12345 wrote:
this is for windows 7 (not on my own comp right now)
goto control panel
goto appearance and personalization
goto folder options
goto the tab: view
uncheck: hide extensions for known file types
for windows XP: (this will come here when im home)
Thanks!
Offline
you have windows 7 then?
or windows vista, they are atthis point almost the same st folders...
Offline
A much easier way to do this is:
step 1
Open notepad, type something, and copy the text. (This makes sure copying in phun works)
step 2
In your phun scene, select what you want to spawn, and press CTRL+C
step 3
Paste into line break remover, and remove.
step 4
Copy from line break remover.
The rest like above post...

Offline
i dont get it, guyboy...
Offline
Bronie12345 wrote:
i dont get it, guyboy...
=O You don't???
Copy objects in phun and paste into notepad... ![]()

Offline
now i get it ![]()
Offline