Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Mar 29, 2024 9:00 am
All times are UTC + 0
Move to Cell
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
krnyoshi
Cyborg Engineer


Joined: 22 Nov 2003
Location: California

PostPosted: Sun Jan 24, 2021 12:20 am    Post subject:  Move to Cell Reply with quote  Mark this post and the followings unread

So I was fiddling around with a map I made a long time ago, and in that map I blew through all the available waypoints that TS allows. In order to try and remedy it I started looking into Move to Cell in the script types. The results.... very mixed.

I noticed that it is VERY limited in where you can tell the units to move to so I'm guessing that either my math formula is wrong somewhere or missing something or the Move to Cell command isn't properly implemented.

The limitations I found are:
1. You cannot move the unit to any cell outside of the playable boundary.
2. The cell specified cannot be on any cell greater than 127 on the x coordinate. Y can be any coordinate so long as it's within the playable boundary.

I tried almost everything I could think of but it just will not work. Anyone else fiddled with Move to Cell and had better results or has more information on it?

The math formula to get the cell # is
CELL_ID = X + ( Y * 128 )

_________________
Creator of Tiberian Sun: Firepower

Back to top
View user's profile Send private message Visit poster's website Skype Account Yahoo Messenger Account AIM Address
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun Jan 24, 2021 5:35 am    Post subject: Reply with quote  Mark this post and the followings unread

Checked in the game.exe. Script action Move to Cell... (4,cell#) still uses 128 to determine the coordinates. Leftover from RA1.

X is cell# % 128 (modulus or remainder) and Y is cell# / 128 (division), so if cell# is 9040 then X is 80 and Y is 70 (leaving decimals)

So, currently it will have problems with maps bigger that 128x128 as coordinate computation will be messed up.

It could be changed in the EXE to use 1000 instead of 128 similar to waypoint or celltags.

Edit:
Added patch to use formula: cell# = x + (y * 1000)
Link - https://github.com/E1Elite/ts-patches/blob/master/src/mods/scriptaction4.asm

Can't find use of this script action in vanilla game maps. Would need change in user created maps if this script action is used along with this patch.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1560s ][ Queries: 11 (0.0066s) ][ Debug on ]