Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: kon on May 15, 2015, 10:54:03 AM

Title: Producing packets and menus HELP NEEDED
Post by: kon on May 15, 2015, 10:54:03 AM
I want to create something like CN, but couldn't find functions/Consts for:
sending packets to units
checking amount of units connected in network
making menus( if you click on the crpl core, down a "disarm, destroy, etc. Menu option )

Please help me  ;)
I want to re-create in my map the CW2's rift unit or what is it's name. The receiving is ok but can't send packets :(
Title: Re: Producing packets and menus HELP NEEDED
Post by: Tyler21 on May 15, 2015, 11:45:37 AM
Quote from: kon on May 15, 2015, 10:54:03 AM
I want to create something like CN, but couldn't find functions/Consts for:
sending packets to units
checking amount of units connected in network
making menus( if you click on the crpl core, down a "disarm, destroy, etc. Menu option )

Please help me  ;)
I want to re-create in my map the CW2's rift unit or what is it's name. The receiving is ok but can't send packets :(

1) As far as I know there is no way to modify the packet generating / sending algorithm.
2) Counting the number of units that are connected is not possible directly. However you can create a complex script that checks every unit whether it received new packets in the last x frames (by comparing the ammo x frames before and now). This usually means that the unit is connected although there are lot of exceptions (for example: unit is at full ammo and is not firing).
3) This is possible though sligthly complicated. You have to create cores (buttons or whatever you might like) that are only activated (visible, clickable) when the player selects the unit and are set to a certain screen position by using SetScreenMode instead of map coordinates.
Title: Re: Producing packets and menus HELP NEEDED
Post by: kon on May 15, 2015, 12:24:06 PM
1, Not possible :O :(
2, If 1 is not possible i don't need 2
3, Is it possible with ShowText to show multiple texts at the same time?
+ Question
How to make sniper or beam etc. Effects?
Title: Re: Producing packets and menus HELP NEEDED
Post by: Tyler21 on May 15, 2015, 02:00:07 PM
Quote from: kon on May 15, 2015, 12:24:06 PM
1, Not possible :O :(
2, If 1 is not possible i don't need 2
3, Is it possible with ShowText to show multiple texts at the same time?
+ Question
How to make sniper or beam etc. Effects?

There is no such command as 'ShowText'.
If you meant the SetText command, you can set only one string for each crplcore.
However, you can break lines and merge multiple strings into a single string so there is relatively big freedom in using SetText.
You can create as many different texts as you wish if you create multiple crpl cores.

For the effects check Telanir's EasyCRPL (http://knucklecracker.com/wiki/doku.php?id=crpl:crpltutorial:easycrpl), look for 'pre-built beam'. The sniper can be programmed in a similar way.
Title: Re: Producing packets and menus HELP NEEDED
Post by: kon on May 15, 2015, 02:59:51 PM
1,Thanks, yes I meant the SetText command. I just don't use it, so I forgot it's name, but I remember that I had issues when trying to show multiple of them, so thanks!
+ thanks
Title: Re: Producing packets and menus HELP NEEDED
Post by: pawel345 on June 17, 2015, 02:05:43 AM
As for the packets, it's not possible to send real packets but you can change the values for ammo and so on so it's possible to create CRPL cores that will behave like packets. It's quite complex but I think someone have done it.