'S' update as of 4/12/11

New releases and general discussions.

Post » Tue Dec 08, 2009 9:48 pm

hey lucid , i've been playing a bit with your "S" plugin and it's great so far :wink: So could you or someone assist me on this? : how do i delete an object and destroy it only without destroying all the others ?? I've tried "destroy object", it destroys the object but do not delete it from array... and "delete object" , removes it from array and destroys all the others (only one type) .Does it has something to do with object range ?
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Thu Dec 10, 2009 6:12 pm

sorry for the late response.
delete an object from an array should give you the option of whether to destroy the object, and should only destroy that one instance, and not all of that type.

ill try to take a look at this when i get home
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Dec 10, 2009 7:48 pm

thnx for the response :D i tried it this way and it worked:

B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Mon Dec 14, 2009 9:21 pm

Hey all,

I'm still new to Construct so I'm a little bit in the dark about its current limitations [namely, based on what I've read in the forums, python scripting bugs]. How exactly does 's' fix python? Is it that 's' provides the functionality that the python scripting can't yet handle, or does it actually extend the python scripting's power by repairing any known issues/adding features? What sort of tasks is the python scripting still struggling with?

Thanks all, and to Lucid- 's' looks amazing!! Keep up the great work :D
B
2
G
3
Posts: 11
Reputation: 872

Post » Wed Dec 16, 2009 9:11 pm

thanks cresco

python currently ignores picking and just applies actions to the first object
so if you had a condition

on collision with Sprite2
----python : Sprite2.x =50

it wouldn't apply to the sprite2 in the collision, it would apply to the first instance of sprite2, no matter what

the upcoming (not yet released) version of S
allows you to loop your python actions through every picked instance of an object

thus fixing this problem of python
the only other python issue I know of is that you can't use system actions
this would be an easy fix, but more time consuming than I can manage at the moment

finishing s is on the backburner for me right now, because my dayjob is unstable, and I need to get my game far enough along that if something happens with my job it isn't impossible to work on in short bursts

however, due to all the python talk on the boards lately, I'm going to probably release the In Between Version I'm currently working with, that has the python fix, and just warn people about the other new (nonpython) features that aren't fully integrated
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Dec 17, 2009 6:14 am

Ah interesting, interesting... Python sounds a lot less 'broken' than I've heard, especially with the inclusion of your fine work. I'm just getting started with Python (and thus haven't gotten into much Construct scripting yet) and I've been wondering-- how exactly does the Python language integrate with the Construct engine? Obviously there must be a special commandset to link the two; do you have any suggestions as to where I should look to learn Construct scripting [is there at least a reference of Construct-specific commands someplace]? How specialized is Python for Construct (would I be able to script effectively if I knew the canonical Python language and had a reference of any Construct-specialized commands/command structures)? Anyway, I hope everything stays well for you at work!

Thanks very much
B
2
G
3
Posts: 11
Reputation: 872

Post » Thu Dec 17, 2009 9:31 am

every action, expression, and condition has a python equivalent
even for 3rd party plugins. it's built into the SDK to require a python command for everything

the expressions are written the same way in construct or in python

so if you can type sprite.angle in construct to get a sprite's angle, it will be the same in python.

most actions and conditions have an obvious python equivalent, but if you're having trouble figuring it out, there is a way to look up the python commands for most plugins.

it may seem a little complicated, but it isn't really

first go to the construct SVN:
[url:2yruqe85]http://construct.svn.sourceforge.net/svnroot/construct/Plugins/[/url:2yruqe85]

and find a plugin you'd like
when you click on the plugin directory (in the SVN link above, not on your hard drive)
there will be a bunch of files to choose from
the only one you need is ACETABLE.cpp

this file contains all the info construct uses to make the plugin's editor interface to actions conditions and expressions

once again, this next part might seem intimidating, but there's only one tiny piece you need, I'm just pasting the whole thing here, so you can have an idea how it'll look in the file
(they won't be highlighted on the SVN) :

this is from the line plugin:
29 ADDPARAM(PARAM_PRIVATEVARIABLE, "Private variable", "Select the private variable to test.");
30 ADDPARAMCOMBO("Comparison", "Select the comparison to make.", "Equal to|Not equal to|Less than|Less or equal|Greater than|Greater or equal");
31 ADDPARAM(PARAM_VALUE, "Value", "Value to compare to");
32 ADDCND([color=#FF0000:2yruqe85]"*Compare a private variable"[/color:2yruqe85], "Private variables", "%o %n: Value %0 %1 %2", &ExtObject::cValueCmp,[color=#00BF00:2yruqe85] "CompareValue"[/color:2yruqe85], 0);


see that last line? the second thing from the end, highlighted in green?

CompareValue

that's the python command. on the very left of this line after ADDCND, highlighted in red, is what you would click on in the construct condition list to add this condition, so to "Compare a private variable", you would you type CompareValue.

one more example:

78 ADDPARAM(PARAM_VALUE, "X", "X of line start to set.");
79 ADDACT([color=#FF0000:2yruqe85]"Set start X"[/color:2yruqe85], "Line", "Set start X to %0", &ExtObject::aSetStartX, [color=#00BF00:2yruqe85]"SetStartX"[/color:2yruqe85], 0);


second from the end is : SetStartX
this is how you "Set start X"

if you use your browser's find function, it is very simple to find whatever it is you clicked on in construct to get an action, and the corresponding python command

hope this helps
without the S fix, which I will try to release this weekend (remind me :wink: )
you can still experiment with python, and get it up and running

I have to leave to work now, but if you search the forums you can find the answers to the following:
there is a certain version of python that must be installed on your system for python to work in construct

have fun
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Dec 17, 2009 5:48 pm

This is REALLY useful advice for people going the python route. IMHO should be in the wiki.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Dec 26, 2009 7:48 pm

Hey Lucid,

I finally got around to messing with S again. I remember you said that the old examples didn't have the ACEs in the right order or something. For the life of me I can't figure out a simple example of adding an object into an array.

http://www.box.net/shared/qqn6400180

I tried to straight copy from your level editor example which doesn't crash. However, I get nothing but crashes when I run into the object to add to the array.

Could you example why the current cap doesn't work as well as how to make the old .tt("blue" example work? Thanks!!
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Dec 27, 2009 2:22 am

k
there are two problems here first:

you're creating an array called "" inside the nonexistant array {"level"}
instead of creating an array called "level" inside of {""}

even though it doesn't crash at this point, there is no array called level, so anytime you try to access it, it will crash
the second problem is:

you're trying to insert into an "object type" array
the array "objs" you created was an object array
this also causes a crash, because 's' is looking for an "object type" array called "objs" which doesn't exist

I think this was a simple oversight, but if you need help with the differences between objects, and objecttypes, just post back, or check out the first post in this thread.

I think now that you realize the mistake, you might not need any help with the tt thing, but post back if you do

thanks for using S :D
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest