Find and Replace attributes in rules??
iTouchGamer
Member Posts: 681
Hey guys, I'm nearing the completion of my next game and I have to do a lot of copying and pasting of rules and changing the attributes. IS there a way to "Find" an attribute, then replace it with a different attribute, kinda like in emails or word documents.
Thanks!
Thanks!
Best Answers
-
gyroscope I am here.Posts: 6,598
@iTouchGamer
Hi, you'll still need to change score1 to score2 each by hand I'm afraid, but...
If your levels are similar with just a few changes per scene, then rather than copying and pasting everything from one scene to another, just duplicate scenes in the Home window (alt + drag). As I say, you'll still have to change attributes but by the sound of it, will save you a ton of time copying and pasting rules/actors, etc if the majority is similar level to level...
Also: sometimes (I find a lot of times, personally) that using the Custom Behaviours facility is a bit quicker than copy and paste when it comes to getting large amounts of rules copied over. And perhaps get into the habit of enclosing multiple rules in group behaviours, so you can grab large chunks of rules in one go to drag into the custom behaviours.""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
gyroscope I am here.Posts: 6,598
You're welcome. And yes you're right, it'd be great for some sort of attributes find and replace... maybe one day.
OK, Custom Behaviours: In the Library, either in the Scene Edit or Actor Edit window, next to the Standard tab, there is a tab called Custom. Click on that; then when in an Actor Edit window, Shift click to select as many rules&behaviours as you need to be the same somewhere else. Then drag to the Custom window and let go. You can double-click the name of the group to change it if you want.
Also, what is the Custom Behaviours facility?
Now when you go to another actor edit window where you want this stuff as well, drag it out into the rules section, then it's all done. :-)
PS I've always thought "Custom" behaviours was a bit misleading as a title; it makes it sound like its for your own behaviours somehow made!""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
gyroscope I am here.Posts: 6,598
@gyroscope
Ah, you forgot about them because the weather's too hot, didn't you? ;-) I forget stuff because... er....um.... I'll let you know when I remember....
Oh, those!! haha I knew that
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
gyroscope I am here.Posts: 6,598
That's it, yes – I get the impression that the Group behaviour is ignored by a lot of people but it's really helpful in quite a few ways - not only for selecting a group of rules and behaviours in one hit for copying; or dragging/alt-dragging between game files; or simply for deleting a lot in one go after just selecting the group; as well as ease of dragging to custom behaviours –– but can be titled like all other behaviours for ease of finding rules and behaviours that "belong to each other".
Hail the humble Group behaviour!
PS I'll mention @MotherHoose and @TheMoonwalls who helped you out here as well. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
… GS changes all references to new name (no work for you)
when you drag a behavior into an Actor … name it!
in the tittle bar: Change Attribute: alpha … or Constrain Attribute: X
when you create a Rule or Group … name it!
in the tittle bar:
Rule: alpha = 0; touch ➢ alpha to 1
Group: Movement
naming things right away … keeps you focused on what you are doing here
seconds spent typing makes your working and debugging and cleaningUp much faster
you can test if an attribute is used … by saving your work as a new project
then trying to delete an attribute in game/scene …
GS will Alert you where the attribute is in use … if it is
and, of course you can look at the content of your project
and, make changes in a textEditor or program that searches/replaces in multiple files
MH
Hmm maybe I'm not explaining it correctly..
Example:
Ok I have 2 attributes-Score1 and Score2
2 Scenes-Level1 and Level2.
Let's say I have a rule in level1 that changes score1 based on something that happened in that level. Now I copy that rule, and paste in in level2. Is there a way to "Find" everywhere it has score1 in the rule, and change it to score2?? I know I could do it manually, but in my game I have almost 50 levels and it's a pain to go "Copy...Paste..change attribute" all day long!
Thanks!
Like this in MSW:
http://images.yourdictionary.com/images/computer/_WDFIND.GIF
Yea, that's what I was afraid of. The scenes are no where near similar so it looks like I'll have to do it all manually
Hopefully GS will implement something similar to Find and Replace...
Thanks!
Also, what is the Custom Behaviours facility?
save a copy of your project
in Inspector: gameAttributes:
highlight score1
click the [-] or keyboard delete
GS will Alert you with a list of all the Actors that reference that attribute
(screenshot that alert … or write down those actors)
cancel the alert
working from your screenshot or list
in those actors … find and change the attribute
MH
I know which actors the attributes are in, I'm copying and pasting the attributes in different scenes.
Thanks though!
Oh, those!! haha I knew that
That might actually be a whole lot easier than copying and pasting!
Thanks!!
If I have like 4 or 5 rules, is there a way to "group" them so I don't have to make all of them custom rules??
Is that what the group rule is for?
Great, thanks again for all your help!!