Announcement: Remember: you are giving away your fantastic ideas for free, and somebody else might even make money from them (or appear to). That's just how the world works! If you're worried about it, maybe you shouldn't post your ideas here.


Caravel Forum : DROD Boards : Feature Requests : Variable renaming doesn't update references to that variable
New Topic New Poll Post Reply
Poster Message
RoboBob3000
Level: Smitemaster
Avatar
Rank Points: 1978
Registered: 10-23-2003
IP: Logged
icon Variable renaming doesn't update references to that variable (0)  
Imagine the following code:
Set var name1 = 1
Set var name2 = name1
If you rename name1 to something like newname, you wind up with the following code:
Set var newname = 1
* Set var name2 = name1
The reference to name1 doesn't get updated.

____________________________
http://beepsandbloops.wordpress.com/
02-03-2008 at 06:07 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Variable renaming doesn't update references to that variable (+1)  
I was thinking about implementing this functionality, but there are a couple of issues that need to be figured out:

1. This would completely disable renaming variables in holds you're not the author of - you'd have to first make a copy of the hold to rename variables.
2. This would require clearing undo state, because a rename would affect many rooms across the whole hold and undo kind of doesn't work the greatest with this. It's probably possible to implement it (and I can kind of see how to do it) but I am not sure if I'd be able to do it correctly.
3. There's a risk it wouldn't work fully correctly.

So my question is - is there enough care in the community to have this implemented?

Edit: also, an alternative solution would be to have an external tool to modify the hold and just rename all of the variable names that way. So you'd first export the hold, import it in the tool, ask it to rename stuff, export from the tool, import the hold in the game.

____________________________
My website | Facebook | Twitter

[Last edited by skell at 10-29-2020 10:00 AM]
10-29-2020 at 09:59 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1531
Registered: 06-13-2015
IP: Logged
icon Re: Variable renaming doesn't update references to that variable (0)  
I think an external tool would be good. Another alternative I'd personally be okay with is if the names are only updated "locally", as in "within the script of the character currently being edited". I don't actually know if that would avoid the other possible issues, though.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 10-29-2020 03:14 PM]
10-29-2020 at 03:14 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Variable renaming doesn't update references to that variable (0)  
I don't think the current behavior is a bug. Moving this topic to FR board.

It does sound like the original observation was made only within the scope of the current script being edited, but I think skell is thinking about this issue the "right" way.

Another suggestion: press a key on the level editor screen to pull up two text input boxes in sequence, where the user enters a current and new variable name. The var rename operation is applied everywhere in the current hold.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 10-29-2020 04:53 PM]
10-29-2020 at 04:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Feature Requests : Variable renaming doesn't update references to that variable
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.